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

example with integer: "definitions: data did not match any variant of untagged enum Resolvable" #327

Open
xehpuk opened this issue Jul 1, 2021 · 1 comment

Comments

@xehpuk
Copy link

xehpuk commented Jul 1, 2021

swagger: "2.0"
info:
  title: Test
  version: "0.5"
definitions:
  error:
    properties:
      code:
        type: integer
        example: 1337 # definitions: data did not match any variant of untagged enum Resolvable at line 6 column 8
    type: object
paths:
  /foo:
    get:
      responses:
        "200":
          description: OK

Has also been mentioned here: #95 (comment)

Seems like only strings are expected there: https://github.com/wafflespeanut/paperclip/blob/4b9205d040a583ef4059db619c0ed3b0f08c42c5/macros/src/core.rs#L287-L290

From the spec:

Property examples can be specified inline. The example value must conform to the property type.

definitions:
  CatalogItem:
    type: object
    properties:
      id:
        type: integer
        example: 38
      title:
        type: string
        example: T-shirt
    required:
      - id
      - title
@tiagolobocastro
Copy link
Collaborator

Yeah we should change that, I tried a fix on my repo, where I changed the example from string into a map: MayastorControlPlane@72fddfe.
Feel free to cherry pick and create a PR, otherwise I can do it when I have some time..

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

2 participants