Skip to content

Handle binary formats for pre-3.1#2966

Draft
Youssef1313 wants to merge 1 commit into
microsoft:mainfrom
Youssef1313:dev/ygerges/handle-formats
Draft

Handle binary formats for pre-3.1#2966
Youssef1313 wants to merge 1 commit into
microsoft:mainfrom
Youssef1313:dev/ygerges/handle-formats

Conversation

@Youssef1313

@Youssef1313 Youssef1313 commented Jul 18, 2026

Copy link
Copy Markdown
Member

The OpenApiSchema model is supposed to represent the latest version of the spec, and adjust accordingly when serializing to older versions.

This PR handles how binary formats are serialized. This means that users can simply define the model properly per the latest version and per the way the object model is designed, and we get correct serialized output for versions earlier than 3.1.

See https://spec.openapis.org/oas/v3.2.0.html#migrating-binary-descriptions-from-oas-3-0 from the spec.

Specifically, type: string, contentEncoding: base64 should map to type: string, format: byte for versions older than 3.1.

In addition, if contentMediaType is specified (without specifying contentEncoding or type), then the format maps to binary.

@Youssef1313
Youssef1313 force-pushed the dev/ygerges/handle-formats branch 2 times, most recently from cdbd348 to fb7d260 Compare July 18, 2026 05:49
@Youssef1313
Youssef1313 force-pushed the dev/ygerges/handle-formats branch from fb7d260 to 86e2fad Compare July 20, 2026 10:19
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

Successfully merging this pull request may close these issues.

1 participant