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

OAS: Body parameter default value could not be retrieved #212

Closed
ostridm opened this issue Sep 18, 2023 · 0 comments · Fixed by #213
Closed

OAS: Body parameter default value could not be retrieved #212

ostridm opened this issue Sep 18, 2023 · 0 comments · Fixed by #213
Assignees
Labels
Type: bug Something isn't working.

Comments

@ostridm
Copy link
Contributor

ostridm commented Sep 18, 2023

The method OasV2ParameterObjectsParser.parseBodyParameter is not able to retrieve the default parameter value when it is specified in /definitions/some-object-definition/schema/default node, as it uses an original instance of the specification document.

const operationObject: OpenAPIV2.OperationObject = jsonPointer.get(
this.doc,
jsonPointer.compile(jsonPointer.parse(pointer).slice(0, -2))
);
const mimeTypes = operationObject.consumes || ['application/json'];
const value = parameter.schema?.default;

The method should take the value from the dereferenced document instance.

@ostridm ostridm added the Type: bug Something isn't working. label Sep 18, 2023
@ostridm ostridm self-assigned this Sep 18, 2023
@pmstss pmstss changed the title OAS: Body parameter default value could not be retrieved by Swagger editor OAS: Body parameter default value could not be retrieved Sep 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: bug Something isn't working.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant