Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenAPI spec document doesn't pass validation #40

Open
hillct opened this issue Oct 9, 2024 · 2 comments
Open

OpenAPI spec document doesn't pass validation #40

hillct opened this issue Oct 9, 2024 · 2 comments

Comments

@hillct
Copy link

hillct commented Oct 9, 2024

  1. In attempting to generate an API library using https://github.com/OpenAPITools/openapi-generator-cli/tree/master
    the https://github.com/coollabsio/documentation-coolify/blob/main/openapi.yaml file doesn't pass validation. The following errors are thrown:
Exception in thread "main" org.openapitools.codegen.SpecValidationException: There were issues with the specification. The option can be disabled via validateSpec (Maven/Gradle) or --skip-validate-spec (CLI).
 | Error count: 7, Warning count: 1
Errors: 
	-attribute paths.'/applications/public'(post).requestBody.content.'application/json'.schema.items is missing
	-paths.'/servers/{uuid}'. Declared path parameter uuid needs to be defined as a path parameter in path or operation level
	-attribute paths.'/applications/{uuid}'(patch).requestBody.content.'application/json'.schema.items is missing
	-attribute paths.'/applications/private-deploy-key'(post).requestBody.content.'application/json'.schema.items is missing
	-paths.'/applications/{uuid}'. Declared path parameter uuid needs to be defined as a path parameter in path or operation level
	-attribute paths.'/applications/private-github-app'(post).requestBody.content.'application/json'.schema.items is missing
	-paths.'/projects/{uuid}'. Declared path parameter uuid needs to be defined as a path parameter in path or operation level
Warnings: 
	-attribute paths.'/applications/public'(post).requestBody.content.'application/json'.schema.items is missing
	-paths.'/servers/{uuid}'. Declared path parameter uuid needs to be defined as a path parameter in path or operation level
	-attribute paths.'/applications/{uuid}'(patch).requestBody.content.'application/json'.schema.items is missing
	-attribute paths.'/applications/private-deploy-key'(post).requestBody.content.'application/json'.schema.items is missing
	-paths.'/applications/{uuid}'. Declared path parameter uuid needs to be defined as a path parameter in path or operation level
	-attribute paths.'/applications/private-github-app'(post).requestBody.content.'application/json'.schema.items is missing
	-paths.'/projects/{uuid}'. Declared path parameter uuid needs to be defined as a path parameter in path or operation level

This can be reproduced using he following steps:

  1. ) npm install @openapitools/openapi-generator-cli
  2. ) npx openapi-generator-cli generate -i "https://raw.githubusercontent.com/coollabsio/documentation-coolify/refs/heads/main/openapi.yaml" -g typescript-axios -o ./coolify-api-client

A friendlier interface can be found here https://editor.swagger.io (just load the openapi.yaml file)

@peaklabs-dev
Copy link
Member

And why exactly do we need to generate it with that API libary? we are using astro starlights OpenAPI implementation

@hillct
Copy link
Author

hillct commented Nov 2, 2024

The document either complies with a specification or it does not. There is no middle ground here unless of course you're claiming that the tool I listed is not an effective evaluator of specification compliance. Is that your claim?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants