Azure / autorest.typescript

Extension for AutoRest (https://github.com/Azure/autorest) that generates TypeScript code. The transpiled javascript code is isomorphic. It can be run in browser and in node.js environment.
MIT License
178 stars 75 forks source link

[modular & RLC] Add patch support #2001

Open MaryGao opened 1 year ago

joheredi commented 9 months ago

After a conversation about this with the TypeSpec team here is some important considerations:

for a model

model Foo {
   bar: string;
   baz?: number;
}

op Update(@header content-type: "application/merge-patch+json", ...Foo): void;
op Create(...Foo): void;

which is used in a merge-patch+json operation, we should implicitly consider baz to be nullable as well only for the context of that operation, while other operations such as post would be true to the model definition.

So the implicit assumptions for the merge-patch+json context are:

For json-merge+patch:

joheredi commented 9 months ago

Addin RLC tag as this may also have implications for RLC, feel free to remove if after investigation it is determined that there is no impact in RLC