Skip to content

Commit d1c3c9e

Browse files
committed
fix: preserve deprecated, readOnly, writeOnly when normalizing OAS 3.1 array schemas
The OpenAPINormalizer.processNormalize31Spec method converts OAS 3.1 JsonSchema array types into legacy ArraySchema objects, but was not copying the deprecated, readOnly, or writeOnly flags during conversion. This caused @deprecated annotations to be silently dropped for array-type properties in all generators when processing OAS 3.1 specs.
1 parent 1aec291 commit d1c3c9e

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

modules/openapi-generator/src/main/java/org/openapitools/codegen/OpenAPINormalizer.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1839,6 +1839,9 @@ protected Schema processNormalize31Spec(Schema schema, Set<Schema> visitedSchema
18391839
as.setXml(schema.getXml());
18401840
as.setNullable(schema.getNullable());
18411841
as.setUniqueItems(schema.getUniqueItems());
1842+
as.setDeprecated(schema.getDeprecated());
1843+
as.setReadOnly(schema.getReadOnly());
1844+
as.setWriteOnly(schema.getWriteOnly());
18421845
if (schema.getItems() != null) {
18431846
// `items` is also a json schema
18441847
if (StringUtils.isNotEmpty(schema.getItems().get$ref())) {

0 commit comments

Comments
 (0)