Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
802 views
in Technique[技术] by (71.8m points)

openapi - Using Swagger, can one mark a field as 'readOnly' for one request and modifiable for another without cloning the schema?

I have 2 API calls for creating and updating a particular record. We would like to express one can specify a value or have it be generated for a specific field on create, but cannot modify it on update.

The only solution I see is to have a model for update and create, but this just creates extra schemas to maintain.

Is there a cleaner way to handle this?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...