Hello:
Open API specification allows to set readOnly and requiered properties on definitions sections such as:
"definitions": {
"MyObject": {
"type": "object",
"properties": {
"Id": {
"type": "integer",
"format": "int32",
"readOnly": true
},
"Name": {
"type": "string"
},
"Description": {
"type": "string"
}
},
"required": ["Name", "Description"]
}
This results in two great effects in documentation when referenced from an API path/method:
- readOnly fields are only presented on GET methods, indicating that is not necessary to provide them on PUT nor on POST (this is a very cummon case for generated values)
- requiered fields are presented as such
We use service builder / *.rodl file to define our API and I can’t figure out how to specify this properties. Is this possible?