Skip to content
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

Linter seems to complain about secret properties from the PUT request misisng from the GET response #739

Open
TimLovellSmith opened this issue Sep 5, 2024 · 1 comment

Comments

@TimLovellSmith
Copy link
Member

Describe the bug

If I correctly understood the cause of the linter warning,
this isn't really a bad thing that needs warnings,
since its a secret property (look for "x-ms-secret"):

https://github.com/Azure/azure-rest-api-specs-pr/blob/df5a3d3ae66802afb6c00cca11a42487d5eae2a0/specification/nginx/resource-manager/NGINX.NGINXPLUS/preview/2024-09-01-preview/swagger.json#L1269

❌ PutRequestResponseSchemeArm | A PUT operation request body schema should be the same as its 200 response schema, to allow reusing the same entity between GET and PUT. If the schema of the PUT request body is a superset of the GET response body, make sure you have a PATCH operation to make the resource updatable. Operation: 'ApiKeys_CreateOrUpdate' Request Model: 'parameters[4].schema' Response Model: 'responses[200].schema'Location: NGINX.NGINXPLUS/preview/2024-09-01-preview/swagger.json#L30 | RPC-Put-V1-25 -- | -- | -- ❌ PutRequestResponseSchemeArm | A PUT operation request body schema should be the same as its 200 response schema, to allow reusing the same entity between GET and PUT. If the schema of the PUT request body is a superset of the GET response body, make sure you have a PATCH operation to make the resource updatable. Operation: 'Configurations_CreateOrUpdate' Request Model: 'parameters[5].schema' Response Model: 'responses[200].schema'Location: NGINX.NGINXPLUS/preview/2024-09-01-preview/swagger.json#L558 | RPC-Put-V1-2
@TimLovellSmith
Copy link
Member Author

If the schema of the PUT request body is a superset of the GET response body, make sure you have a PATCH operation to make the resource updatable.

Or is this really what its complaining about?? Its hard to tell.

That 'needs a patch' should probably even be a separate linter warning, to make it easier to understand

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant