Skip to content

Examples are not extracted from path operations #157

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

Open
recmanj opened this issue Mar 3, 2025 · 1 comment
Open

Examples are not extracted from path operations #157

recmanj opened this issue Mar 3, 2025 · 1 comment

Comments

@recmanj
Copy link

recmanj commented Mar 3, 2025

I've got an OpenAPI spec that defines the parameter examples under path operations like in Adding Examples
:

parameters:
  - in: query
    name: status
    schema:
      type: string
      enum: [approved, pending, closed, new]
      example: approved # Example of a parameter value

This gets completely ignored even when using --useExamples argument and random values get generated instead. Is this expected behaviour? Would it be possible to implement extracting these kind of examples?

Thanks.

@en-milie
Copy link
Contributor

en-milie commented Mar 4, 2025

Hi @recmanj. Can you post the entire OpenAPI spec you are using? I'm not able to reproduce it. I've pasted the above definition in a petstore.yml and I properly get all the examples:

{
  "id": 78,
  "page": "test",
  "status": "approved"
}

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