OpenAPITools / OpenAPITools/openapi-generator

[BUG] Examples are not generated

Open
#6,823 3 comments 6 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Issue: Bug
Dominant language
Java
Stars
26.8k
Forks
7.7k
PR merge metrics
PR metrics pending

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue with the provided OpenAPI YAML using the javaSpring generator and Maven plugin version 4.3.0. Inspect the generated response output and related generator behavior; the work is done when the declared application/hal+json example appears in the generated result.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, openapi, spring
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.