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

[Bug]: Incorrect PATCH request schema #3485

Closed
4 tasks done
markcowl opened this issue May 30, 2024 · 1 comment
Closed
4 tasks done

[Bug]: Incorrect PATCH request schema #3485

markcowl opened this issue May 30, 2024 · 1 comment
Labels
bug Something isn't working lib:http

Comments

@markcowl
Copy link
Contributor

markcowl commented May 30, 2024

Describe the bug

The OpenAPI3 emitter will put readOnly properties into the PATCH request schema, provided all properties are optional as in this playground

However, it does create separate schema omitting the read-only property as expected, if this (or any) property is marked required as in this playground

Reproduction

Playground showing read-only property in patch input schema

Playground showing a required property creatign a new schema removing the read-only property

Checklist

@markcowl markcowl added the bug Something isn't working label May 30, 2024
@markcowl markcowl changed the title [Bug]: TypeSpec does not generate update request schema for PATCH properties that are readOnly and optional (but does if they are required) [Bug]: TypeSpec does not generate update request schema for PATCH properties that are readOnly and optional (but does if there is any required property)) May 30, 2024
@markcowl markcowl changed the title [Bug]: TypeSpec does not generate update request schema for PATCH properties that are readOnly and optional (but does if there is any required property)) [Bug]: Incorrect PATCH request schema May 30, 2024
@markcowl
Copy link
Contributor Author

markcowl commented Jun 3, 2024

This is by design - readOnly properties can be safely shared between input and output schema, and we correctly treat "create", "read" visibility in this case.

@markcowl markcowl closed this as completed Jun 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working lib:http
Projects
None yet
Development

No branches or pull requests

1 participant