Apicurio / apicurio-studio

Open Source API Design
https://www.apicur.io/studio/
Apache License 2.0
983 stars 494 forks source link

Editor: Support readOnly/writeOnly for data type properties #729

Open siscia opened 5 years ago

siscia commented 5 years ago

Hi all,

I am trying to set some properties of a data type to be readOnly.

Is that possible/supported? Maybe it is just me not seeing it.

I am ingot the https://studio.apicur.io platform.

Cheers, Simone

EricWittmann commented 5 years ago

Hi @siscia - the OpenAPI specification supports both readOnly and writeOnly for properties, but Apicurio currently does not. However, you can set those values in the Source tab and they will be preserved. Here is a reference to the specification:

https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.2.md#fixed-fields-20

I've converted this Issue from a Question into a Feature Request. :) It won't be difficult for us to add this functionality.

siscia commented 5 years ago

Hi @EricWittmann ,

thanks!

I will use the source tab for the moment.

Thanks for apicurio !

Cheers, Simone

(I leave the issue open, feel free to close it.)

EricWittmann commented 5 years ago

OK great - I'm going to leave this open until we implement readOnly/writeOnly!

EricWittmann commented 5 years ago

Note on this issue - the readOnly property exists in both OpenAPI 2.0 and 3.x - but the writeOnly property exists only in OpenAPI 3.x.