[BUG] [SPRING] not able to get example value in @ApiParam when it is defined in spec
Created by: ashimjk
Bug Report Checklist
-
Have you provided a full/minimal spec to reproduce the issue? -
Have you validated the input using an OpenAPI validator (example)? -
What's the version of OpenAPI Generator used? -
Have you search for related issues/PRs? -
What's the actual output vs expected output? -
[Optional] Bounty to sponsor the fix (example)
Description
I am not able to get an example value in @ApiParam when I tried to generate spring code.
OpenAPI declaration file content
openapi: 3.0.1
info:
title: Swagger Petstore
version: 1.0.0
tags:
- name: pet
description: Everything about your Pets
paths:
'/pet/{petId}/{petId2}':
get:
tags:
- pet
summary: Find pet by ID
description: Returns a single pet
operationId: getPetById
parameters:
- name: petId
in: path
description: ID of pet to return
required: true
schema:
type: integer
format: int64
example: 12
- name: petId2
in: path
description: petId2
required: true
schema:
type: string
example: ashim
responses:
'200':
description: successful operation
content: {}
Command line used for generation
docker run --rm \
-v $PWD:/local openapitools/openapi-generator-cli generate \
-i /local/petstore.yaml \
-g spring \
-o /local/out/spring
Steps to reproduce
After the code generation, there is no example in PetApi for petId and petId2.