OpenAPITools / openapi-generator

OpenAPI Generator allows generation of API client libraries (SDK generation), server stubs, documentation and configuration automatically given an OpenAPI Spec (v2, v3)
https://openapi-generator.tech
Apache License 2.0
21.24k stars 6.43k forks source link

[BUG] Examples are not generated #6823

Open AxelHeathnet opened 4 years ago

AxelHeathnet commented 4 years ago

Description

I'm writing the following API:

responses:
        '200':
          description: the full list of resp
          content:
            application/hal+json:
              schema:
                $ref: '#/components/schemas/MyResponse'
              examples:
                FirstExample:
                  description: first example
                  value:
                    idIstance: idIstance

And using the javaSpring generator. The example section is empty even though, as you can see, I'm putting them in.

openapi-generator version

Maven plugin version 4.3.0

praiz commented 2 years ago

When using other generators, the section with examples is also not generated. (html, html2, typescript)

frankjkelly commented 1 month ago

This would be very nice to fix - without examples it's hard to understand how to correctly use more complex APIs. Thanks in advance!

frankjkelly commented 1 month ago

FYI see some history here https://github.com/OpenAPITools/openapi-generator/issues/881