azure-functions-openapi-extension icon indicating copy to clipboard operation
azure-functions-openapi-extension copied to clipboard

Swagger is not being generated when 2 properties are named the same in the JSON

Open Zircon99 opened this issue 6 months ago • 1 comments

Description

Swagger is not being generated when 2 properties are named the same in the JSON

As an example:

{ "Data": { "PaymentStatusReport": { "GroupHeader": { "MessageIdentification": "68aeee18-ff7b-bbbc-adc9-e6ad276f7b8e", "CreationDateTime": "2025-03-26T14:22:56.7458341+00:00" }, "OriginalGroupInformationAndStatus": { "MessageIdentification": "", "OriginalMessageNameIdentification": "", "GroupStatus": "ABCD", "StatusReasonInformation": null } }

Although MessageIdentification have different parent properties, the Swagger generation breaks because it sees them as the same thing (duplicate definition), instead of as 2 unique properties.

Steps to reproduce

Create a structure that has 2 properties named the same, but with different parents properties - in this case, "MessageIdentification":

{ "Data": { "PaymentStatusReport": { "GroupHeader": { "MessageIdentification": "68aeee18-ff7b-bbbc-adc9-e6ad276f7b8e", "CreationDateTime": "2025-03-26T14:22:56.7458341+00:00" }, "OriginalGroupInformationAndStatus": { "MessageIdentification": "", "OriginalMessageNameIdentification": "", "GroupStatus": "ABCD", "StatusReasonInformation": null } }

Allow it to generate Swagger.

Result - the Swagger generation breaks, as it sees "MessageIdentification" being defined twice, instead of seeing them as two unique properties, as they have unique parent properties.

Zircon99 avatar Jun 06 '25 08:06 Zircon99

Same issue here

jsparent-ca avatar Dec 10 '25 03:12 jsparent-ca