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

open-api: Use openapi-generator-gradle-plugin for validating specification #9344

Merged
merged 2 commits into from
Feb 8, 2024

Conversation

dramaticlly
Copy link
Contributor

Today we have open-api specification validated as part of github actions/workflow when PR was submitted (or by author running make task)

This PR tried to use openapi-generator-gradle-plugin for open-api specification validation on build, with recommendations. I added validation to both s3-signer-open-api.yaml and rest-catalog-open-api.yaml

Good spec

./gradlew :iceberg-open-api:build
Starting a Gradle Daemon (subsequent builds will be faster)

> Task :iceberg-open-api:validateRESTCatalogSpec
Validating spec /Users/stevezhang/workspace/iceberg/open-api/rest-catalog-open-api.yaml
Spec is valid.

Bad spec

> Task :iceberg-open-api:validateRESTCatalogSpec FAILED
Validating spec /Users/stevezhang/workspace/iceberg/open-api/rest-catalog-open-api.yaml

Spec is invalid.
Issues:

        attribute .servers.foo is unexpected

        attribute .servers.url is missing


FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':iceberg-open-api:validateRESTCatalogSpec'.
> Validation failed.

@dramaticlly
Copy link
Contributor Author

@Fokko @nastra if you want to take a look?

Copy link
Contributor

@Fokko Fokko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great, thanks for working on this @dramaticlly

@Fokko Fokko merged commit 44eb00d into apache:main Feb 8, 2024
42 checks passed
@dramaticlly dramaticlly deleted the openapiGradle branch February 14, 2024 00:58
devangjhabakh pushed a commit to cdouglas/iceberg that referenced this pull request Apr 22, 2024
zachdisc pushed a commit to zachdisc/iceberg that referenced this pull request Dec 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants