Broken readOnly + required combination
See original GitHub issueDescribe the bug if prop is set to readOnly and required POST/PUT body validation is failing with “required item is missing” (I’m at version 4.1.0)
To Reproduce example schemas:
Item:
allOf:
- $ref: '#/components/schemas/id'
- $ref: '#/components/schemas/name'
id:
properties:
id:
type: string
readOnly: true
required:
- id
name:
properties:
name:
type: string
required:
- name
Actual behavior Error is thrown:
{
"errorCode": "required.openapi.validation",
"message": "should have required property 'id'",
"path": ".body.id"
}
Expected behavior if prop is set to readOnly it’s not checked in POST/PUT body
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
ios - Does @property copy in combination with readonly make ...
So yes, you're correct... readonly creates a getter method and copy would be effectively ignored, since there's no setter method that does assignment....
Read more >[SOLVED 2022] Attempted to Write to Read-Only Memory Issue
Method 2. Check your computer's memory ... This is possible on the command line; the only command that you need to enter is...
Read more >Spread properties on inputs have unexpected readonly ...
We need to re-set input.required = is_required after every time attrs is updated as well. This is why the code was originally written...
Read more >Unable to open /dev/sdb read-write (Read-only file system)
First try the command sudo hdparm -r0 /dev/sdb (method taken from another askubuntu answer). Then try remounting rw the partition. If these steps...
Read more >read-only - CSS: Cascading Style Sheets - MDN Web Docs
The :read-only pseudo-class is used to remove all the styling that makes the inputs look like clickable fields, making them look more like...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
👍 true. we missed some
type: object
in yml.and issue is gone with latest version. thank you for fixing it.
ah missed comment. I will definitely try to create some code example for the case… or will find a bug in our schemas 🤔