Skip to content
This repository was archived by the owner on Dec 25, 2024. It is now read-only.

[REQ] restructure endpoint data to allow components/X imports #34

Closed
spacether opened this issue Oct 7, 2022 · 1 comment · Fixed by #89, #97, #100 or #101
Closed

[REQ] restructure endpoint data to allow components/X imports #34

spacether opened this issue Oct 7, 2022 · 1 comment · Fixed by #89, #97, #100 or #101
Labels
enhancement New feature or request
Milestone

Comments

@spacether
Copy link
Contributor

spacether commented Oct 7, 2022

Is your feature request related to a problem? Please describe.

Header + Response
parameters have schema or content.mediaType.schema

And parameter names must be unique for (location + name)

So one needs a form like:
Only request and response bodies use contenttype for ParamNameOrContentType
{Request/ResponseFor{status}}{Query/Cookie/Header/Path/Body}{{ParamNameOrContentType}}Schema

  • RequestQueryStatusSchema
  • RequestBodyApplicationJsonSchema
  • ResponseFor200HeaderStatusSchema

Without this, schemas could collide
Another solution is to make the parent instances into classes, and have the schema definitions inline
That is more complicated

The more complicated solution is preferred because one should be able to$ref shared definition components that define RequestBodies/Parameters/Responses/Headers
This restructuring will also allow schemas to be inherited from PathItem parameters

Describe the solution you'd like

Describe alternatives you've considered

Additional context

@spacether spacether linked a pull request Oct 7, 2022 that will close this issue
3 tasks
@spacether spacether added this to the 2.0.0 milestone Oct 12, 2022
@spacether spacether changed the title [REQ] prevent collisions between endpoint schemas [REQ] restructure endpoint data to allow component/X imports Oct 13, 2022
@spacether spacether changed the title [REQ] restructure endpoint data to allow component/X imports [REQ] restructure endpoint data to allow components/X imports Oct 13, 2022
@spacether spacether added the enhancement New feature or request label Nov 8, 2022
@spacether spacether removed a link to a pull request Dec 7, 2022
3 tasks
@spacether
Copy link
Contributor Author

Feature is available in the 2.0.0 release

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.