Handle cases where the body is undefined when the schema lacks body data.
Exclude the mediaType property when obtaining data of schema type.
The code in change 2 were made solely to fix a bug, without considering the package architecture. As a result, they might need to be refactored to align with the architecture (TODO).
Suggestion
I believe your team needs test code. When developing a new feature, it's also crucial to ensure that it doesn't have any adverse effects on the existing features.
Describe bug
Issues can arise in the following two scenarios
mediaType
is specified above the request body or response body, it results in the generation of an invalid OAS.Reproduction
Version
0.1.105
Case 1: If API spec does not have a body
Schema
Result
Failed to generate OAS
Case 2: If
mediaType
are specified above the request or responseSchema
Result
An invalid OAS is generated, which includes
mediaType
propertyChanges
undefined
when theschema
lacks body data.mediaType
property when obtaining data ofschema
type.The code in change 2 were made solely to fix a bug, without considering the package architecture. As a result, they might need to be refactored to align with the architecture (TODO).
Suggestion
I believe your team needs test code. When developing a new feature, it's also crucial to ensure that it doesn't have any adverse effects on the existing features.