swagger-editor icon indicating copy to clipboard operation
swagger-editor copied to clipboard

Object type can't support property of type integer with any name except id

Open jaronwest opened this issue 1 year ago • 0 comments

Q&A (please complete the following information)

  • OS: macOS
  • Browser: chrome
  • Version: 103
  • Method of installation: docker
  • Swagger-Editor version: latest
  • Swagger/OpenAPI version: OpenAPI 3.0

Content & configuration

This does not work:

paths:
  /v1/test:
    get:
      parameters:
        - in: query
          name: filter
          schema:
            type: object
            properties:
              anything:
                type: integer

However this does work:

...
            properties:
              id:
                type: integer

And this works:

...
            properties:
              anything:
                type: string

Describe the bug you're encountering

Within paths/parameters I would expect to be able to add an -in: query of type object that has a property of type: integer and named something different from id. This also prevents me from including more than one integer property as they can't both be named id. Swagger editor provides no errors or warnings that the name must be id. When running the api it simply returns [object][object] 401 bad request.

jaronwest avatar Aug 02 '22 15:08 jaronwest