Please take a look at the Screenshot #1. For me this feels like a pretty obvious use case - to be able to have referenced element as readonly/writeonly in the context of the schema that references it.
The lack of it limits usage of components drastically, at least in our APIs. I have to create a new copy of a schema just to mark the same object as readonly in few contexts.
Please consider at least supporting a manual entry (Screenshot #2)
For example, in our API we have a common way to represent internationalized content. For example, let’s say I have a Post and it has title, slug and body:
So, i’ve created a schema like this (it’s more complicated, i left only what is relevant here) to describe such structure, let’s call it LocalizedContent:
However, It does not make sense to set “readOnly” property on this schema globally, as some model attributes are readonly, and some are not - for example Post has editable title and body, but slug is autogenerated
In other words, when i reference LocalizedContent on Post’s attributes, I need to specify that slug is readonly. Without it, I would have to create a “readonly” version of this schema ([READONLY] LocalizedContent :D) or just copy-paste it without reference.
The example above may feel a bit complicated and specific to just one case, but because of the same issue, we cannot fully efficiently use “primitives” like these that make the whole API specs more clean and DRY:
For example, in our API we have a common way to represent internationalized content. For example, let’s say I have a Post and it has title, slug and body:
So, i’ve created a schema like this (it’s more complicated, i left only what is relevant here) to describe such structure, let’s call it LocalizedContent:
However, It does not make sense to set “readOnly” property on this schema globally, as some model attributes are readonly, and some are not - for example Post has editable title and body, but slug is autogenerated
In other words, when i reference LocalizedContent on Post’s attributes, I need to specify that slug is readonly. Without it, I would have to create a “readonly” version of this schema ([READONLY] LocalizedContent :D) or just copy-paste it without reference.