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

Discussion: some OAS Enhancer additions for discussion #4539

Closed
wants to merge 5 commits into from

Conversation

dougal83
Copy link
Contributor

@dougal83 dougal83 commented Jan 29, 2020

I've put together some OAS Enhancer additions for discussion if any are of interest to create a PR. I'm just looking at tidying the output, removing unnecessary spec pollution, reorder in a way that I see as more logical and others, see commits.

  • feat(rest): add openapi schema consolidation ... consolidate schemas to components for reuse
  • feat: add prune enhancer … remove pollution "x-...", "title" properties
  • feat: add default deprecate enhancer … add deprecated: "false" by default to be verbose
  • feat: add tags enhancer … copy tags to global tags, can add description tbd
  • feat: add restructure enhancer … rearrange spec to more logical order (IMO)

(Core in bold, others could be optional community addons)

Can look at others on suggestion. Might need @jannyHou to help integrate properly on rest server. :)

Please take a look at the resultant openapi.json spec from these enhancers.

@derdeka
Copy link
Contributor

derdeka commented Jan 30, 2020

Some of theese "x-..." and "title" properties are used by different sdk generators to generate frontend code. Removing this stuff might break frontend code generation.

@dougal83
Copy link
Contributor Author

dougal83 commented Jan 30, 2020

Some of theese "x-..." and "title" properties are used by different sdk generators to generate frontend code. Removing this stuff might break frontend code generation.

I understand that title can be used, that was tentatively added. Do you have any practical examples for use of the x- variable perchance? I had a cursory look but didn't find any applicable examples at the time. There is https://swagger.io/docs/specification/openapi-extensions/ but I could not justify it. This would not be a core extension, optional candidate at best.

The consolidator could be the only core worthy addition.

add security enhancer to add default security scheme

impl. loopbackio#4386

Signed-off-by: Douglas McConnachie <[email protected]>
make rest server getApiSpec method async

Signed-off-by: Douglas McConnachie <[email protected]>
add openapi spec enhancer to rest server with security enhancer by default

impl. loopbackio#4365

Signed-off-by: Douglas McConnachie <[email protected]>
Add openapi schema enhancer to consolidate entire openapi schema

Schema enhancer added to openapi-v3 package, utilised in rest server. Creates references to schema to reduce duplication.

Signed-off-by: Douglas McConnachie <[email protected]>
add example enhancers

Signed-off-by: Douglas McConnachie <[email protected]>
@dougal83
Copy link
Contributor Author

dougal83 commented Feb 5, 2020

Closed. Move discussion to issue later.

@dougal83 dougal83 closed this Feb 5, 2020
@dougal83 dougal83 removed the request for review from jannyHou February 5, 2020 10:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants