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

Implement support for exporting Swagger/OpenAPI definitions, clean up backend lambda #350

Merged
8 commits merged into from
Mar 5, 2020

Conversation

ghost
Copy link

@ghost ghost commented Feb 25, 2020

Issue #, if available: Closes #309.

Description of changes:

  • I added a second dropdown for exporting API definitions, where the modal gives the following options:

    • Checkboxes to include x-amazon-apigateway-integration, x-amazon-apigateway-authorizer, and Postman extensions
    • Radio buttons to select export type (currently only JSON and YAML)

    I reused the same modal and related logic as the SDK exports, as it was basically the same. I just added a couple new field types. I also added a new backend route (basically a clone of the existing SDK generation one) to get the API export and fixed a related bug I discovered where it was checking for the wrong ID (it should've checked the API ID, not the global ID). And of course, I rebuilt the assets.

  • I modularized and cleaned up the lambda backend so it's easier to look through - it got tiring having to Cmd+F every 2-3 minutes to jump around multiple locations in the file.

  • I also did a little bit of cleanup in the form of removing a bit of catalog code that really should've been removed when the comment was initially written.

  • I addressed npm audit issues and resolved them where applicable.

Note: don't merge this yet - it's intentionally a draft so I can get some early feedback. It's also based on #347, and so I need to wait for that to get merged before this can be merged.

Edit: Updated description.
Edit 2: Slipped another fix in. Also, it's now open for review.
Edit 3: Closes #332, closes #333, closes #335, closes #352

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@ghost ghost force-pushed the meaisiah-export branch from ad52589 to 7ec3a32 Compare February 26, 2020 02:52
amazon-meaisiah added 7 commits March 4, 2020 11:23
All the various extensions listed in the docs are also supported,
including Postman extensions, x-amazon-apigateway-integration
extensions, x-amazon-apigateway-authorizers extensions, and combinations
of all three. You can also choose whether to export as YAML or JSON.
It's a separate dropdown, but reuses the same modal, and it just
delegates to AWS in a lambda to generate the export. (The logic is
nearly identical to the SDK generation.)
@ghost ghost force-pushed the meaisiah-export branch from b7cca8d to c8e5a96 Compare March 4, 2020 19:24
@ghost ghost marked this pull request as ready for review March 4, 2020 19:24
@ghost ghost mentioned this pull request Mar 4, 2020
@ghost ghost merged commit 36f9338 into master Mar 5, 2020
@ghost ghost deleted the meaisiah-export branch March 5, 2020 20:42
@ghost ghost restored the meaisiah-export branch March 5, 2020 20:48
@ghost ghost deleted the meaisiah-export branch March 5, 2020 20:58
This pull request was closed.
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

Successfully merging this pull request may close these issues.

downloadable Swagger defs/Postman config from Developer Portal
2 participants