Render AsyncAPI union response variants#926
Draft
danielporterda wants to merge 1 commit into
Draft
Conversation
Contributor
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
Signed-off-by: danielporterda <daniel.porter@digitalasset.com>
dda150a to
43462b5
Compare
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.
Screenshot
Shows the generated
/v2/updatessubscribe output schema now rendering bothJsCantonErrorandJsGetUpdatesResponse, including the nestedupdatevariants.Summary
oneOf/anyOfpayload variants in the generator instead of rendering only the first branch sampleJsGetUpdatesResponse.updateRoot cause
The AsyncAPI source for
/v2/updatescorrectly modelsEither_JsCantonError_JsGetUpdatesResponseasoneOf [JsCantonError, JsGetUpdatesResponse], butschema_sample_value()collapsedoneOf/anyOfschemas to branch zero. Because branch zero isJsCantonError, generated docs omitted the success branch.Validation
python3 -m pytest tests/test_asyncapi.pynpm run generate:json-api-asyncapi-referencepython3 -m pytest tests/test_asyncapi.py tests/test_openrpc.pypython3 -m py_compile src/x2mdx/asyncapi/lifecycle.py src/x2mdx/asyncapi/render.py src/x2mdx/reference_pages.pygit diff --checkNote: I also tried
tests/test_asyncapi.py tests/test_openrpc.py tests/test_protobuf.py;tests/test_protobuf.py::ProtobufTests::test_cli_builds_overview_and_package_pagesfailed on an existing relative-link assertion (packages/...expected,./packages/...rendered), unrelated to this AsyncAPI change.