I’m trying to write an open api document, involving a PUT request with a parameter in the path, something like PUT /settings/{settingId}
I want the JSON payload to be minimalistic, looking like this:
{
“value”: “something”
}
The settings at hand, identified with their settingId, must respect various types, patterns or regular expressions, for which I’d like to use JSON schemas. For exemple, if settingId = eth_enable, I want the value to be a boolean.
I’m a beginner in the field, but it feels like the answer to my problem is not on the internet yet, and that’s why I’m asking here now (after asking ChatGPT, who led me on a wrong path for about a week 😅). Is what I am trying to do feasible with JSON schemas, or are path parameters unusable with JSON schemas?
Thanks in advance for any and all hints!
I have searched for an answer on the internet for a while now, but it seems that all the implementations I found were JSON schemas based on properties, never on path parameters.
Robin Mahéo is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.