-
-
Notifications
You must be signed in to change notification settings - Fork 7.1k
Open
Description
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?
Description
The issue was fixed in #3622 based on isModel
attribute. If the enum has isModel
set to true, then the enum isn't generated in objects it's referenced. However, looks like how isModel
is set was changed in #3855 . Now enums no longer have isModel
set.
openapi-generator version
4.2.0 master
OpenAPI declaration file content or url
openapi: 3.0.2
info:
title: Test
version: 0.1.0
servers:
- url: http://localhost
paths:
/:
post:
operationId: test
responses:
200:
description: test
components:
schemas:
TestObject:
type: object
properties:
enumInObject:
$ref: "#/components/schemas/TestEnum"
TestEnum:
type: string
enum:
- value1
- value2
Command line used for generation
openapi-generator generate -g aspnetcore
Steps to reproduce
- generate
TestEnum
is generated both inTestEnum.cs
andTestObject.cs
Related issues/PRs
Suggest a fix
Is there any other way to tell if an enum is referenced or inlined?