Repository navigation
fix: keep strings that look like numbers quoted in AsyncAPI bundles - #1328
Merged
Merged
Conversation
AsyncApiBundler wrote YAML with MINIMIZE_QUOTES but without ALWAYS_QUOTE_NUMBERS_AS_STRINGS, so a string such as the CloudEvents specversion const "1.0" came out as the number 1.0. Enable the feature, as swagger-core's YAML writer for OpenAPI bundles already does.
jjjasper
approved these changes
Nov 11, 2026
jjjasper
enabled auto-merge (squash)
November 11, 2026 15:14
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
boat:bundlefor AsyncAPI writes strings that look like numbers without quotes. A CloudEvents envelope withis bundled as
const: 1.0, which YAML reads as the number 1.0. No message then validates against the published bundle (/specversion: must be the constant value '1.0'), and consumers have to patch the spec before they can use it. The same happens toenum: ["1", "2"],examples: ["123"]and any other string that looks like a number.Root cause
AsyncApiBundlerhas its own YAML writer withMINIMIZE_QUOTESbut withoutALWAYS_QUOTE_NUMBERS_AS_STRINGS. OpenAPI bundles don't have the problem: they go through swagger-core'sObjectMapperFactory, which enables both. This PR enables the missing feature. Real numbers are written as numbers and stay unquoted.Verification
AsyncApiBundlerTest.keepsStringsThatLookLikeNumbersQuotedfails onmainand passes here.mvn -B testpasses for all modules.Not fixed here
While writing the test,
maximum: 10in a draft-2020-12 schema came out of the bundle asmaximum: 1E+1. That comes from the schema projection, not the YAML writer, so it is left for a separate fix.Made with Cursor