feat: add TOML v1.0 serialization support#2828
feat: add TOML v1.0 serialization support#2828Thyago-Oliveira-Perez wants to merge 1 commit intomicrosoft:mainfrom
Conversation
Adds OpenApiTomlWriter (mirrors OpenApiJsonWriter / OpenApiYamlWriter),
a new OpenApiConstants.Toml constant, and SerializeAsTomlAsync extension
methods so callers can export an OpenAPI document as TOML.
Public API declared in PublicAPI.Unshipped.txt; RS0026 suppressed for
consistency with existing SerializeAsJson/YamlAsync overloads.
|
@microsoft-github-policy-service agree |
baywet
left a comment
There was a problem hiding this comment.
Hi @Thyago-Oliveira-Perez
Thank you for using the SDK and for reaching out.
Thanks for the contribution!
I'm a bit mixed on this proposal and wished you had started by creating an issue first to have a discussion.
OpenAPI descriptions are by design deeply nested, and TOML does not seem to be designed for that. Additionally, the ecosystem support for TOML, and demand for it is low to inexistant. (no prior issue on the matter)
As for this PR: I'm really questioning the usefulness of having the ability to serialize to, but not deserialize from TOML. I understand this might be useful to convert and push to other systems that only accept TOML, but I'd be surprised to see any system that only accepts TOML in 2026. Implementing the deserialization would need to be done in a companion library like yaml is done today. And would allow us to validate roundtrips actually work.
Before we make any further code changes, can you please expand on why you think TOML is necessary? Why it needs to be in the "official library" (and not in a community owned peer)? And what you're trying to achieve (beyond supporting TOML)?
Thanks!
Pull Request
Description
Type of Change
Related Issue(s)
Changes Made
Testing
Checklist
Versions applicability
See the contributing guidelines for more information about how patches are applied across multiple versions.
Additional Notes