Experiment: can <Schema> render SWML schemas no operation references? - #620
Closed
fern-api[bot] wants to merge 1 commit into
Closed
Experiment: can <Schema> render SWML schemas no operation references?
#620fern-api[bot] wants to merge 1 commit into
fern-api[bot] wants to merge 1 commit into
Conversation
Contributor
Author
|
Requested by: Devon White |
Contributor
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
Throwaway experiment (do not merge) to answer: if a schema exists in
components.schemasbut no operation references it, can<Schema type="...">still render it?Setup, using messaging SWML as the test subject:
swml-scriptscore + create/update requests):SWML.Messaging.*schemas — so "leave the definitions in the spec" needs a second step.fern/apis/signalwire-rest/openapi-overrides.yaml, wired up ingenerators.yml:SWML.Messaging.*is present in the merged spec and reachable from zero operations, requests, responses, webhooks or channels.ParamFieldblocks on thereplypage for the equivalent schema refs:ParamField(a barestringhas no schema to point at).Definition-level result so far (local
fern fdr): all orphan types survive the OpenAPI → Fern → FDR conversion, including nested refs (SwmlMessagingReplyWithBody,SwmlMessagingReplyInlineSwitch,SwmlMessagingSwitchTransform, …), with 0 errors. Whether the docs frontend resolves them for<Schema>is what the preview on this PR decides.Note the calling side is deliberately untouched: making
contentsunknownon both union variants ofSwmlScript/SwmlScriptCreateRequestmakes the variants indistinguishable and breaks example validation ("Missing discriminant property (script_type)"), so only the messaging variant was loosened.Requested by: Fern Support