I have a YAML file and I want to generate equivalent class of this YAML file by OpenAPI code generator (openapi-generator-maven-plugin). my YAML file is something like this:
penapi: 3.0.3
info:
title: blah blah
description: blah blah
version: 1.0.0
components:
schemas:
Object1Model:
description: requested array of object2
type: object
properties:
object2Model:
type: array
items:
$ref: '#/components/schemas/Object2Model'
Object2Model:
description: Object2 Model
type: object
required:
- "field1"
- "field2"
properties:
field1:
description: field1
type: string
field2:
description: field2
type: string
day1:
$ref: "../../commons.yml#/definitions/weekday"
day2:
$ref: "../../commons.yml#/definitions/weekday"
paths: { }
I have weekday enum in another file:
swagger: "2.0"
info:
title: Commons file
description: Common elements used across all of the REST APIs
version: 1.0.0
paths: {}
definitions:
# Weekday enum used to represent the weekdays.
weekday:
type: string
enum:
- MON
- TUE
- WED
- THU
- FRI
- SAT
- SUN
description: Day of a week.
example: FRI
and my YAML file referes correctly to this file. I want to use Weekday enum generated by Commons file and use existing enum, but OpenAPI generates it again. How can I avoid generating Weekday enum?