You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Object still appears in request schema when readOnly property is set to true at the object level.
Expected behavior
The entire object should be excluded from the request schema when readOnly property is set to true at the object level. ReDoc renders the schema correctly, so it appears to be a Docusaurus issue.
Current behavior
readOnly is set to true on the ownerRefobject, but the ownerRef object is still visible in the request schema.
Possible solution
Steps to reproduce
Set readOnly: true at object level in schema
Object still appears in request schema
ownerRef:
type : object
readOnly: true
description: >-
The owner of this template, and the owner of campaigns generated from this template via a schedule. This field
is automatically populated at creation time with the current user.
properties:
id:
type: string
description: Id of the owner
example: 2c918086676d3e0601677611dbde220f
type:
type: string
enum:
- IDENTITY
description: Type of the owner
example: IDENTITY
name:
type: string
description: Name of the owner
example: Mister Manager
email:
type: string
description: Email of the owner
example: [email protected]
Screenshots
Context
We need to be able to exclude entire objects, not just individual properties from the request schema.
Your Environment
Version used: 2.4.3
Environment name and version: node.js v20.12.2, npm 10.5.0, python 3.12.3
Operating System and version (desktop or mobile): Win 11 Pro
My workaround was creating a Python script to create a new OpenAPI spec with components split into a version for requests (without readOnly properties) and another for responses (that can have the readOnly properties).
Then, I built the documentation from the new OpenAPI spec, and it worked fine.
I hope it helps you @christina-gagnon-sp.
Activity
JaimeOVasconcelos commentedon May 27, 2024
I have reported the same problem:
My workaround was creating a Python script to create a new OpenAPI spec with components split into a version for requests (without readOnly properties) and another for responses (that can have the readOnly properties).
Then, I built the documentation from the new OpenAPI spec, and it worked fine.
I hope it helps you @christina-gagnon-sp.
Jaime
sserrata commentedon Jun 24, 2024
Hi @christina-gagnon-sp, can you try installing
0.0.0-726canary release to see if the issue has been resolved? Thanks!sserrata commentedon Jun 28, 2024
Confirmed fix works as expected using the example provided in this issue.