swagger-core icon indicating copy to clipboard operation
swagger-core copied to clipboard

Bug in AccessMode.WRITE_ONLY?

Open klauss42 opened this issue 3 years ago • 0 comments

After having trouble using WRITE_ONLY I looked in the code and saw the following in class AnnotationsUtils:

// process after readOnly and writeOnly
if (schema.accessMode().equals(io.swagger.v3.oas.annotations.media.Schema.AccessMode.READ_ONLY)) {
    schemaObject.setReadOnly(true);
    schemaObject.setWriteOnly(null);
} else if (schema.accessMode().equals(io.swagger.v3.oas.annotations.media.Schema.AccessMode.WRITE_ONLY)) {
    schemaObject.setReadOnly(false);
    schemaObject.setWriteOnly(null);

To me the WRITE_ONLY handling looks obviously wrong, as it calls schemaObject.setWriteOnly(null). Is this the correct and intended behaviour?

klauss42 avatar Jul 29 '22 08:07 klauss42