To run the spec locally you can use:
npm run cdk:cli
The importer is under connector import
. The importer will only work JSON specs. You can add a spec as a JSON file to the root of the project.
The connector will output the connector to the root along with an errors.json
if any errors are found.
This module speeds up the development process of creating a new Tray CDK connector by parsing an OpenAPI specification file for a given API and generating operation handlers, meta data, input and output types.
This beta functionality is available from the @trayio/cdk-cli module via the tray-cdk import-openapi-spec
command. If you encounter any issues that you wish the team to investigate further please supply us with OpenApi specification you are importing and the errors.json
that has been generated during the import process.
These are the features that are currently supported/unsupported:
- OpenAPI spec interpretation:
- Supported:
- schema internal component references
- JSON OpenAPI specification version 3
- If your version is older you can use this to update it: Swagger Editor (From the top menu bar, select edit, convert to Open API 3, you can also use this to convert from YAML to JSON)
- Unsupported:
- Swagger API version 2
- YAML spec files
- open API specs with multiple server URLs, manually edit the file to set your desired server to the first in the array
- recursive schema references
- external schema references
- schema references that target nested components
- Supported:
- Authentication
- Unsupported:
- generation of Auth type
- handlers utilising the auth token in handlers
- Unsupported:
- Input/output types:
- Supported:
- Primitive types: number, string, boolean
- Objects
- 2XX response schemas
- Empty input/output
- Unsupported:
- enum types
- array types
- non 2XX response schemas
- Supported:
- Request/Response types:
- Supported:
- Json request/response
- Unsupported:
- xml request/response
- text request/response
- file request/response
- form request/response
- Supported: