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

Responses object doesn't support extensions #687

Closed
TristanSpeakEasy opened this issue Nov 30, 2022 · 1 comment · Fixed by #763
Closed

Responses object doesn't support extensions #687

TristanSpeakEasy opened this issue Nov 30, 2022 · 1 comment · Fixed by #763

Comments

@TristanSpeakEasy
Copy link
Contributor

According to the OpenAPI Spec the responses object should be able to have extensions added to it https://spec.openapis.org/oas/v3.0.3#responses-object This object MAY be extended with [Specification Extensions](https://spec.openapis.org/oas/v3.0.3#specificationExtensions).

But the latest version of kin-openapi doesn't expose extensions for the openapi3.Responses type which at the moment looks to be just a type alias to a map

@fenollp
Copy link
Collaborator

fenollp commented Dec 30, 2022

Correct! Responses should be turned into a

struct {
	Extensions map[string]interface{} `json:"-"`

	map[string]*ResponseRef `json:"responses"`
}

with custom Un/MarshalJSON implementations. I'm in the middle of #513 but that work should make the fix for this issue easier.

Also

func (responses Responses) Get(status int) *ResponseRef {
return responses[strconv.FormatInt(int64(status), 10)]
}
needs to try 21X and 2XX type fields...

fenollp added a commit to fenollp/kin-openapi that referenced this issue Jan 23, 2023
Signed-off-by: Pierre Fenoll <pierrefenoll@gmail.com>
fenollp added a commit to fenollp/kin-openapi that referenced this issue Feb 3, 2023
Signed-off-by: Pierre Fenoll <pierrefenoll@gmail.com>
@fenollp fenollp linked a pull request Feb 6, 2023 that will close this issue
fenollp added a commit to fenollp/kin-openapi that referenced this issue Feb 14, 2023
Signed-off-by: Pierre Fenoll <pierrefenoll@gmail.com>
fenollp added a commit to fenollp/kin-openapi that referenced this issue Mar 14, 2023
Signed-off-by: Pierre Fenoll <pierrefenoll@gmail.com>
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 a pull request may close this issue.

2 participants