8000 Add OpenAPI schema for public REST API by viren-nadkarni · Pull Request #11025 · localstack/localstack · GitHub
[go: up one dir, main page]

Skip to content

Add OpenAPI schema for public REST API #11025

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

Merged
merged 56 commits into from
Sep 2, 2024
Merged

Add OpenAPI schema for public REST API #11025

merged 56 commits into from
Sep 2, 2024

Conversation

viren-nadkarni
Copy link
Member
@viren-nadkarni viren-nadkarni commented Jun 14, 2024

This PR introduces the OpenAPI schema for the internal endpoints in LocalStack.

Contributions:

  • A YAML file with (in localstack-core/localstack/openapi) that contains the entire spec for the endpoints in community. The specs have been handcrafted by @viren-nadkarni 🙌 .
  • We added a step that validates the spec in the lint target. The same check is added also to the pre-commit hooks.
  • We added a validator in the handler that validates the requests to the internal endpoints according to the OpenAPI spec. This step can be disabled with the OPENAPI_VALIDATE_REQUEST variable. OPENAPI_VALIDATE_RESPONSE activates the same check for the responses. It's currently activated by default in our CI pipeline.
  • A few unit tests.

@viren-nadkarni viren-nadkarni self-assigned this Jun 14, 2024
Copy link
github-actions bot commented Jun 14, 2024

S3 Image Test Results (AMD64 / ARM64)

  2 files    2 suites   3m 39s ⏱️
420 tests 368 ✅  52 💤 0 ❌
840 runs  736 ✅ 104 💤 0 ❌

Results for commit 75c6201.

♻️ This comment has been updated with latest results.

Copy link
github-actions bot commented Jun 14, 2024

LocalStack Community integration with Pro

    2 files  ±0      2 suites  ±0   1h 33m 59s ⏱️ +57s
3 412 tests ±0  3 014 ✅ ±0  398 💤 ±0  0 ❌ ±0 
3 414 runs  ±0  3 014 ✅ ±0  400 💤 ±0  0 ❌ ±0 

Results for commit 75c6201. ± Comparison against base commit 16b8245.

♻️ This comment has been updated with latest results.

@viren-nadkarni viren-nadkarni added the semver: minor Non-breaking changes which can be included in minor releases, but not in patch releases label Jun 19, 2024
@viren-nadkarni viren-nadkarni force-pushed the public-api-schema branch 4 times, most recently from 013d4df to c0d4afe Compare June 26, 2024 12:02
@viren-nadkarni viren-nadkarni added this to the Playground milestone Jul 22, 2024
@viren-nadkarni viren-nadkarni removed their assignment Aug 20, 2024
@giograno giograno requested a review from alexrashed August 21, 2024 19:56
@giograno giograno marked this pull request as ready for review August 22, 2024 15:24
Copy link
Member
@alexrashed alexrashed 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 a great first iteration, finally introducing a machine-readable spec for all endpoints which are not clearly defined by the AWS APIs! 🚀 🤖
I added quite a few comments, lots of them are just questions (for this and later iterations), but also a few suggestions for changes. Let me know if I can help anywhere!

@giograno giograno marked this pull request as draft August 27, 2024 12:47
@giograno giograno marked this pull request as ready for review August 27, 2024 14:17
@localstack localstack deleted a comment from localstack-bot Sep 2, 2024
Copy link
Member
@alexrashed alexrashed left a comment

Choose a reason for hiding this comment

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

Thanks for addressing the comments. The iteration is lookin' great! We now have an opt-out request validator, an opt-in response validator (which is enabled in the tests), and most importantly a package-root openapi spec for all the already existing non-AWS-operation endpoints! 💯
Thanks a lot, @viren-nadkarni and @giograno! This is a great step towards a well defined API used by all kinds of SDKs / tools!

@giograno giograno merged commit fcd110d into master Sep 2, 2024
43 checks passed
@giograno giograno deleted the public-api-schema branch September 2, 2024 09:44
giograno added a commit that referenced this pull request Sep 2, 2024
giograno added a commit that referenced this pull request Sep 3, 2024
Co-authored-by: Giovanni Grano <me@giograno.com>
(cherry picked from commit fcd110d)
giograno added a commit that referenced this pull request Sep 3, 2024
Co-authored-by: Giovanni Grano <me@giograno.com>
(cherry picked from commit fcd110d)
giograno added a commit that referenced this pull request Sep 4, 2024
Co-authored-by: Giovanni Grano <me@giograno.com>
(cherry picked from commit fcd110d)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver: minor Non-breaking changes which can be included in minor releases, but not in patch releases
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0