-
Notifications
You must be signed in to change notification settings - Fork 4k
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
api-gateway: allow adding documentation via L2 #22777
Comments
Idea is to be able to specify api gateway document parts in an openapi.yaml|json file and then add endpoints in the cdk code, like the example given here: https://docs.aws.amazon.com/cdk/api/v2/python/aws_cdk.aws_apigateway/SpecRestApi.html. Another way to view this feature is to support Documentation Part and DocumentationVersion that API Gateway supports but the CDK does not, as noted in the following closed ticket #6057. Note the comment that "Your specific request will be serviced as part of our implementation for that". In essence, there is a need to specify title, version (info), description and other documentation-specific information in the openapi.yaml |
Can you post a snippet of example code to show how you would want to use this feature, if it existed? The code I am asking you to write will use APIs that do not currently exist, and therefore not compile. That is okay. I want to get a sense of how you imagine this new API to look and work. |
Here's a snippet from working code, although using SpecRestApi following by endpoint additions results in openapi.yaml prevailing (no endpoints show up in deployment, except GET / [root or landing page]).
Ideally, I would like to add title and description doc to each endpoint as well as top-level doc in openapi.yaml and then just add the endpoint call pieces (e.g., GET /) as you see in the example code above. This allows openapi.yaml to be merged with endpoint integration elements, thus decoupling method/resource bindings from documentation of those bindings. I would also like schema model information to be in the openapi.yaml and just reference it in the cdk code, ideally. Let me know if you need more details. |
My question is, how does the future look in your mind? Would you like to write this: accounts_and_org_data = rest_api.root.add_resource(path_part="accountsandorgdata",
title='My title',
description='My description') ? Or something else? |
Ideally, adding doc to an endpoint call for a resource should be as general as OpenAPI allows, but these are some key features, roughly, we now use in OpenAPI.yaml|json + SAM:
|
Describe the feature
Right now, the only way to add documentation to resources is using the L1s (creating
CfnDocumentationParts
).Request is to add a nice L2 API for this.
Use Case
The use case mentioned by the customer is to start an API model in Swagger, and then add resources to it using CDK (which cannot be documented.
Proposed Solution
No response
Other Information
No response
Acknowledgements
CDK version used
newest
Environment details (OS name and version, etc.)
N/A
The text was updated successfully, but these errors were encountered: