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

[Bug] Style simple + Object with Path Variables is not working #2090

Open
shikhashah45 opened this issue May 2, 2024 · 0 comments
Open

[Bug] Style simple + Object with Path Variables is not working #2090

shikhashah45 opened this issue May 2, 2024 · 0 comments

Comments

@shikhashah45
Copy link

shikhashah45 commented May 2, 2024

Hi, I am using swagger request validator library (version 2.22.0) in my project with below yaml configurations.

info:
  title: Sample API
  version: 1.0.0
openapi: 3.0.0
paths:
  /demo/{groupIdentifier}:
    get:
      description: This API which will provide all the members of a group.
      operationId: get-group-v2
      responses:
        "200":
          description: Successful response
    parameters:
    - description: Composite group identifier
      explode: false
      in: path
      name: groupIdentifier
      required: true
      allowReserved: true
      schema:
        properties:
          domainCode:
            description: Code of the master data domain
            type: string
          groupTypeCode:
            description: The prototype type of the group that has to be searched
            type: string
        type: object
      style: simple

running api gives me below error :
{ "fault": { "faultstring": "OASValidation MAM-SpecValidation with resource "oas://openapi.yaml": failed with reason: "[ERROR - Unable to parse JSON - Unrecognized token 'domainCode': was expecting (JSON String, Number, Array, Object or token 'null', 'true' or 'false')\n\t at [Source: (String)"domainCode,CUSTOMER,groupTypeCode,CUSTOMER_GROUP"; line: 1, column: 11].: []]"", "detail": { "errorcode": "steps.oasvalidation.Failed" } } }

in the api call, I am passing path variables in object format (comma seperated) as mentioned in the doc - https://swagger.io/docs/specification/serialization/

ex. http://test.com/demo/domainCode,CUSTOMER,groupTypeCode,CUSTOMER_GROUP

Also, I debugged the library and found that its trying to convert comma-seperated values in json and hence, giving this error.

@shikhashah45 shikhashah45 changed the title Style simple + Object with Path Variables is not working [Bug] Style simple + Object with Path Variables is not working May 2, 2024
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

No branches or pull requests

1 participant