Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

OpenApi v3 parameter default value not handled #2672

Open
emerikool opened this issue Oct 5, 2022 · 0 comments
Open

OpenApi v3 parameter default value not handled #2672

emerikool opened this issue Oct 5, 2022 · 0 comments

Comments

@emerikool
Copy link

  • OS: mac
  • Environment: Chrome 105
  • Method of installation: npm
  • Swagger-Client version: 3.18.5
  • Swagger/OpenAPI version: OpenAPI 3.0

Content & configuration

Swagger/OpenAPI definition:
PetstoreV3.yaml with default: 'whatever' property added to /user/#-get-parameters-username-schema

Swagger-Client usage:

SwaggerClient.execute({
    "spec": {...PetsoreV3JsonDescribedAbove}
    "method": "get",
    "pathName": "/user/#",
    "parameters": {},
    "requestContentType": "application/json",
    "responseContentType": "application/json",
})

Describe the bug you're encountering

On openApi v3, not supplied parameters with a default value are not sent when exucuting the corresponding action

To reproduce...

Steps to reproduce the behavior:

  1. In an openApi v3 spec action, add a default value to a non required parameter
  2. Execute the action without supplying the parameter which have a default value

Expected behavior

Not supplied parameter with a default value should be sent like in V2:
https://github.com/swagger-api/swagger-js/blob/master/src/execute/index.js#L215

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant