-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add x-immutable vendor extension #1290
Comments
How do we know that the It seems there would need to be maybe a configuration map to define which http methods the immutability applies to... |
@adamaltman Yeah, if we need a config map that would be ok by me. I know that some APIs use PUT for creation for idempotency. If you don't want a boolean |
@adamaltman Come to think of it, even if a field is immutable, it still has to be specified on |
That makes the scope clear. 👍 🎉 Thanks @codyaray! |
Microsoft use |
Still interested in this :) |
me too |
Hi - One of the issues we're running into with our API spec and API docs is around immutable properties. That is, a property that can be set on create (
POST
) but not updated later (viaPATCH
orPUT
).Today ReDoc shows
immutable: true
inside the "Request Body Schema" since I'm using anx-immutable: true
vendor extension in my OpenAPI doc. However, what I'd really like is to just not show these properties in the Request Body Schema on PUT/PATCH at all.Ideally this
immutable
attribute would be standardized by OpenAPI itself, but until that happens... vendor extensions are our next best bet.One obvious alternative option is to use separate schemas, like
FooCreate
andFooUpdate
but that doesn't work well with other tooling (e.g., SDKs from openapi-generator would end up with separate classes for each schema and lots of unnecessary boilerplate translation inside each client). This was the way we were using originally...The text was updated successfully, but these errors were encountered: