-
Notifications
You must be signed in to change notification settings - Fork 422
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
Validation of endpoints against a given OpenAPI schema #3645
Comments
What's the "user story" here? Is it something like:
? |
This, or: develops an API, publishes it, and wants to ensure that anything that's changed doesn't break the published contract |
softwaremill/sttp-apispec#157 introduced
Possible improvements to
Further work needed to have a full OpenApi comparator:
|
Proposed structure for compatibility issues reported by full OpenAPI comparator
Compatibility issues for
Note: "writer" and "reader" correspond to:
|
Current state: we've got the What's left to do:
|
/bounty $750 |
💎 $750 bounty • SoftwareMillSteps to solve:
Thank you for contributing to softwaremill/tapir! Add a bounty • Share on socials
|
/attempt #3645
|
As we are getting first PRs for the bounties, I've published our "How to prepare a good PR" guide. I should have probably done this right away, sorry! :) |
@adamw is this issue is still open .would love to work on it . |
@adamw @kernel-loophole I have worked on it and need a few quick fixes and will draft PR soon |
/attempt #3645 Options |
Note The user @Saturn225 is already attempting to complete issue #3645 and claim the bounty. We recommend checking in on @Saturn225's progress, and potentially collaborating, before starting a new solution. |
Related to softwaremill#3645 Implement `OpenAPIVerifier` in the `openapi-docs` module to verify endpoints against a given OpenAPI spec. * Add `OpenAPIVerifier` class in `docs/openapi-docs/src/main/scala/sttp/tapir/docs/openapi/OpenAPIVerifier.scala` - Implement three modes: exact, at-least, and at-most - Use `OpenAPIComparator` to compare `OpenAPI` instances * Add tests for `OpenAPIVerifier` in `docs/openapi-docs/src/test/scalajvm/sttp/tapir/docs/openapi/OpenAPIVerifierTest.scala` - Test all three modes: exact, at-least, and at-most - Use sample endpoints and OpenAPI specs for testing
@vishwamartur: Reminder that in 7 days the bounty will become up for grabs, so please submit a pull request before then 🙏 |
What about reusing openapi-diff . I have used this tool standalone in CI to check for compatibility with previous openapi specs of projects. But it could easily be included in tests as it is a java module. Could probably save a lot of work and maintenance for this project. |
@abdelfetah18 yes this looks like the good direction. Would be good to have tests which read @ThijsBroersen ah didn't know about that :) We could definitely use it as well - as long as we can provide an appropriate interface on top (comparing endpoints to a specification, ignoring unimportant details (descriptions, examples), and providing exact/at-least/at-most modes |
/attempt #3645 Options |
Note The user @Saturn225 is already attempting to complete issue #3645 and claim the bounty. We recommend checking in on @Saturn225's progress, and potentially collaborating, before starting a new solution. |
@promisingcoder: Reminder that in 7 days the bounty will become up for grabs, so please submit a pull request before then 🙏 |
/attempt #3645
|
💡 @abdelfetah18 submitted a pull request that claims the bounty. You can visit your bounty board to reward. |
🎉🎈 @abdelfetah18 has been awarded $750! 🎈🎊 |
Sometimes it might be desirable to verify if the endpoints match a given OpenAPI schema. To implement this, we would need to parse the schema (see softwaremill/sttp-apispec#2 - although this is already partially done), and then invoke comparison of the two schemas (generated from endpoints & parsed), ignoring fields which do not matter (e.g. descriptions, or examples)
The text was updated successfully, but these errors were encountered: