OpenAPI v3 Syntax Linting for APIMatic Code Generation
Linting checks performed by APIMatic on provided OpenAPI v3 file to check its conformance to recommended syntax practices for better code generation experience.
Note: Some rules on this page apply to SDK test generation and CodeGen settings, which Codegen v4 doesn't use. APIMatic still reports them if your API definition includes those settings.
| Property | Value |
|---|---|
| Ruleset ID | openapi-v3-codegen-syntax-linting |
| Code prefix | OPENAPI3CODEGENSYNTAX_L |
| Type | Linting |
| Default severity | Warning |
| Rule system | Syntax |
| Rules | 33 |
OpenAPI Info
| Code | Rule | Severity | What it checks |
|---|---|---|---|
OPENAPI3CODEGENSYNTAX_L050 | valid-info-title | Error | For successful Code Generation, the title must only use letters, numbers, underscores and dashes. It must not contain any leading/trailing white-space characters. |
OpenAPI Servers
| Code | Rule | Severity | What it checks |
|---|---|---|---|
OPENAPI3CODEGENSYNTAX_L090 | valid-environment-name | Error | For successful Code Generation, the environment name must only use letters, numbers, underscores and dashes. It must not contain any leading/trailing white-space characters. Environment Names are often used for naming the files generated as part of the code generation process, so, any forbidden file name characters are not allowed. |
OPENAPI3CODEGENSYNTAX_L091 | valid-server-name | Error | For successful Code Generation, the server name must only use letters, numbers, underscores and dashes. It must not contain any leading/trailing white-space characters. Names are often used for naming the files generated as part of the code generation process, so, any forbidden file name characters are not allowed. |
OPENAPI3CODEGENSYNTAX_L092 | valid-server-variables-key | Error | For successful Code Generation, the server variables key must only use letters, numbers, underscores and dashes. It must not contain any leading/trailing white-space characters. |
OPENAPI3CODEGENSYNTAX_L093 | valid-server-parameter-name | Error | For successful Code Generation, the server parameter name must only use letters, numbers, underscores and dashes. It must not contain any leading/trailing white-space characters. Names are often used for naming the files generated as part of the code generation process, so, any forbidden file name characters are not allowed. |
OpenAPI Components
| Code | Rule | Severity | What it checks |
|---|---|---|---|
OPENAPI3CODEGENSYNTAX_L130 | valid-schema-component-key | Error | For successful Code Generation, the Schema Component key must only use letters, numbers, underscores and dashes. It must not contain any leading/trailing white-space characters. |
OpenAPI Path Items
| Code | Rule | Severity | What it checks |
|---|---|---|---|
OPENAPI3CODEGENSYNTAX_L170 | valid-path-item-parameter-name | Error | For successful Code Generation, the path item level parameter name must only use letters, numbers, underscores and dashes. It must not contain any leading/trailing white-space characters. Names are often used for naming the files generated as part of the code generation process, so, any forbidden file name characters are not allowed. |
OpenAPI Operations
| Code | Rule | Severity | What it checks |
|---|---|---|---|
OPENAPI3CODEGENSYNTAX_L190 | valid-operation-id | Error | The id of an Operation Object specified using the operationId property is a unique identifier of the operation in the complete API document. This id is used by the code generation engine to generate relevant components tied to an endpoint. Therefore, the id must be short and code-friendly. The id must only use letters, numbers, underscores and dashes. It must not contain any leading/trailing white-space characters. Names are often used for naming the files generated as part of the code generation process, so, any forbidden file name characters are not allowed either. |
OPENAPI3CODEGENSYNTAX_L191 | valid-operation-summary | Error | For successful Code Generation, the operation summary must only use letters, numbers, underscores and dashes. It must not contain any leading/trailing white-space characters. |
OPENAPI3CODEGENSYNTAX_L192 | valid-operation-parameter-name | Error | For successful Code Generation, the operation level parameter name must only use letters, numbers, underscores and dashes. It must not contain any leading/trailing white-space characters. Names are often used for naming the files generated as part of the code generation process, so, any forbidden file name characters are not allowed. |
OpenAPI Operation Settings
| Code | Rule | Severity | What it checks |
|---|---|---|---|
OPENAPI3CODEGENSYNTAX_L240 | valid-operation-method-name | Error | Method names must use letters, numbers, spaces, underscores and dashes only. It must start with a letter. |
OPENAPI3CODEGENSYNTAX_L241 | valid-operation-error-template-key | Error | The key of an error template entry must be a valid error HTTP status code/range (e.g. 4XX, 500) or set to 0 to represent default/undeclared errors. |
OPENAPI3CODEGENSYNTAX_L242 | valid-operation-error-template-message-format | Error | Value of an error template entry must be a valid string message, with support for expression templates. |
OpenAPI Operation Test Cases
| Code | Rule | Severity | What it checks |
|---|---|---|---|
OPENAPI3CODEGENSYNTAX_L340 | valid-test-case-name | Error | For successful Code Generation, the test case name must only use letters, numbers, underscores and dashes. It must not contain any leading/trailing white-space characters. |
OPENAPI3CODEGENSYNTAX_L341 | no-trailing-leading-spaces-in-test-case-name | Warning | The test case's name should not contain any leading or trailing white-space characters.' |
OPENAPI3CODEGENSYNTAX_L342 | test-case-request-uri-begins-with-forward-slash | Error | The request URI for unit test cases specified under operation object must begin with a forward slash. |
OpenAPI Schemas
| Code | Rule | Severity | What it checks |
|---|---|---|---|
OPENAPI3CODEGENSYNTAX_L610 | valid-schema-title | Error | For successful Code Generation, the schema title must only use letters, numbers, underscores and dashes. It must not contain any leading/trailing white-space characters. |
OPENAPI3CODEGENSYNTAX_L611 | valid-schema-properties-key | Error | For successful Code Generation, the schema property keys must only use letters, numbers, underscores and dashes. It must not contain any leading/trailing white-space characters. |
OPENAPI3CODEGENSYNTAX_L612 | valid-schema-enum-element-name | Error | For successful Code Generation, the enum item name must only use letters, numbers, underscores and dashes. It must not contain any leading/trailing white-space characters. |
OPENAPI3CODEGENSYNTAX_L613 | no-trailing-leading-spaces-in-schema-enum-element-name | Warning | Name of a schema enum element should not contain any leading or trailing white-space characters. |
OpenAPI Security Schemes
| Code | Rule | Severity | What it checks |
|---|---|---|---|
OPENAPI3CODEGENSYNTAX_L740 | valid-api-key-security-scheme-name | Error | For successful Code Generation, the name of the ApiKey Security Scheme must only use letters, numbers, underscores and dashes. It must not contain any leading/trailing white-space characters. |
OPENAPI3CODEGENSYNTAX_L741 | valid-additional-header-name | Error | For successful Code Generation, the name of the additional header must only use letters, numbers, underscores and dashes. It must not contain any leading/trailing white-space characters. |
OpenAPI OAuth 2.0 Flows
| Code | Rule | Severity | What it checks |
|---|---|---|---|
OPENAPI3CODEGENSYNTAX_L760 | no-space-in-oauth-flow-scope-key | Error | Scope keys in OAuth flow must not contain spaces. |
OpenAPI Security Requirements
| Code | Rule | Severity | What it checks |
|---|---|---|---|
OPENAPI3CODEGENSYNTAX_L780 | no-space-in-security-requirement-scope-value | Error | Scope values in OAuth flow must not contain spaces. |
OpenAPI Code Generation Settings
| Code | Rule | Severity | What it checks |
|---|---|---|---|
OPENAPI3CODEGENSYNTAX_L800 | valid-php-composer-package-name-codegen-setting | Error | PHP Composer package name must match the naming rules specified in the composer schema file. |
OPENAPI3CODEGENSYNTAX_L801 | valid-php-namespace-name-codegen-setting | Error | PHP namespace name must not contain forbidden characters or use invalid format. |
OPENAPI3CODEGENSYNTAX_L802 | valid-java-group-id-codegen-setting | Error | Java Group ID must match the naming rules specified in maven guides. |
OPENAPI3CODEGENSYNTAX_L803 | valid-java-artifact-id-codegen-setting | Error | Java Artifact ID must match the naming rules specified in maven guides. |
OPENAPI3CODEGENSYNTAX_L804 | valid-controller-postfix-codegen-setting | Error | Controller postfix string must use letters, numbers, underscore and dashes only. |
OPENAPI3CODEGENSYNTAX_L805 | valid-do-not-split-words-codegen-setting-entry | Error | An entry for Do-Not-Split words CodeGen setting must be longer than a single character and use only alphanumeric characters. |
OPENAPI3CODEGENSYNTAX_L806 | valid-error-templates-codegen-setting-key | Error | The key of an error template entry must be a valid error HTTP status code/range (e.g. 4XX, 500) or set to 0 to represent default/undeclared errors. |
OPENAPI3CODEGENSYNTAX_L807 | valid-error-templates-codegen-setting-message-format | Error | Value of an error template entry must be a valid string message, with support for expression templates. |
Miscellaneous
| Code | Rule | Severity | What it checks |
|---|---|---|---|
OPENAPI3CODEGENSYNTAX_L900 | valid-apimatic-extension-property-type | Warning | Type of an APIMatic specific extension property must be in accordance with the type expected for that property. |
Learn more
OpenAPI v3 Linting for APIMatic Code Generation
Linting checks performed by APIMatic on provided OpenAPI v3 file to check its conformance to recommended practices for better code generation experience.
OpenAPI v3 Linting for APIMatic Portal Generation
Linting checks performed by APIMatic on provided OpenAPI v3 file to check its conformance to recommended practices for a more user-friendly API documentation.