redoc icon indicating copy to clipboard operation
redoc copied to clipboard

readOnly property is not marked in HTML

Open sejvlond opened this issue 5 years ago • 5 comments

Properties marked as readOnly are not visually marked as readOnly in HTML see: image

example

packets:
    type: integer
    minimum: 0
    readOnly: true 

(also they are not present at all in the request, already reported here https://github.com/Redocly/redoc/issues/948)

tested on 2.0.rc14

sejvlond avatar Nov 06 '19 11:11 sejvlond

Issue #948 is already answered.

As stated in open api spec:

readOnly properties are included in responses but not in requests, and writeOnly properties may be sent in requests but not in responses.

As far as I can see Redoc is following that perfectly.

TheM1984 avatar Nov 07 '19 09:11 TheM1984

As far as I can see Redoc is following that perfectly.

may be not, schema is not the request-payload, so it should be shown and marked as readonly in the schema. However the generated request-sample should not include the readonly field, as it represent the request-payload

issue #948 is not yet closed. and it is correctly pointing out that Redoc is at odds with other viewers such as swagger-ui and rapi-doc

baboonmaj avatar Nov 11 '19 08:11 baboonmaj

and this issue is about something else - I'm not saying that readonly property is not displayed in the request (that's #948), I'm saying that in the response, where the readonly property is shown - it is not visually marked as readonly, you can't tell from the generated doc, see the screenshot. For comparison see the swagger ui image

sejvlond avatar Nov 11 '19 08:11 sejvlond

Related: #991

lornajane avatar Jul 26 '23 15:07 lornajane

I have the same issue that in the response: the readonly property is shown - it is not visually marked as readonly, you can't tell from the generated doc

potatolianyi avatar Aug 22 '23 20:08 potatolianyi