Skip to content

OpenApi v3 parameter default value not handled #2672

@emerikool

Description

@emerikool
  • 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/login-get-parameters-username-schema

Swagger-Client usage:

SwaggerClient.execute({
    "spec": {...PetsoreV3JsonDescribedAbove}
    "method": "get",
    "pathName": "/user/login",
    "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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions