bug(addresses): fix address schema displays #133
Merged
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.
In short:
The discriminator is unnecessary: it adds complexity & prevents the schema from displaying properly. Getting rid of it doesn't actually negatively affect the functionality, but it allows the schema to display.
Redocly doesn't understand how to deal with allOf at the beginning of the
address.yml
file inshared/models
. This format totally messes it up:Given that, the DRY format doesn't quite work for this. I manually included all the fields in address_us and address_intl, and that solved the issues I was seeing in to and from for mailpieces, wherein I kept seeing Recursive instead of the expected schema. Note that this isn't the first time Redocly has had issues with false-positive recursion.
Weirdly,
allOf
at the beginning of a file DOES work elsewhere, but at this point I'm ready to throw up my hands and implement whatever works.PLEASE go through this with a fine-tooth comb, including generating the docs and poring over them, to see if I broke anything 😓 I think there are some files I might be able to get rid of, if they're not being referenced at all, but I haven't consolidated that information yet.