-
Notifications
You must be signed in to change notification settings - Fork 286
Description
Describe the bug
For some bizarre reason if there is a single usage of a enum or even an object type it embeds it inside of the parent type or endpoint. I have no idea why you'd think this was a good idea, but it breaks everything including naming conventions and more. Just like every other openapi library on C# and indeed Java and every other lanaguage, all complex types and enums should be separate components in the schema and referenced.
OpenApi File To Reproduce
"BankingChatContextDto": {
"required": [
"contact",
"bankAccounts",
"externalFundingSources"
],
"type": "object",
"properties": {
"contact": {
"required": [
"id",
"name",
"avatarUrl",
"contactType",
"emailAddresses",
"phoneNumbers",
"addresses"
],
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "Id",
"format": "uuid",
"nullable": false
},
"name": {
"type": "string",
"description": "Name",
"nullable": false
},
"avatarUrl": {
"type": [
"null",
"string"
],
"description": "Avatar Url",
"nullable": false
},
etc.
There should be absolutely no way that the contact property should be inlining the object.
Expected behavior
The. contact property which is of type ContactDetailDto should be a ContactDetailDto component in the schema, and this should have a reference to it.
The same goes for enums being inlined instead of broken out correctly.
Additional context
If you absolutely must have this silly behavior, then give us a flag to turn it off because it breaks merging of api documentation behind a proxy, screws up clients, and breaks naming conventions.