Skip to content
This repository has been archived by the owner on Jun 14, 2022. It is now read-only.

Do Not Reference, Fully Qualify Type Names #70

Closed
wants to merge 16 commits into from

Conversation

tooolbox
Copy link
Contributor

This PR adds two options to the Reflector. I'll quote from the source:

// Do not reference definitions.
// All types are still registered under the "definitions" top-level object,
// but instead of $ref fields in containing types, the entire definition
// of the contained type is inserted.
// This will cause the entire structure of types to be output in one tree.
DoNotReference bool

// Use package paths as well as type names, to avoid conflicts.
// Without this setting, if two packages contain a type with the same name,
// and both are present in a schema, they will conflict and overwrite in
// the definition map and produce bad output.  This is particularly
// noticeable when using DoNotReference.
FullyQualifyTypeNames bool

My particular use case was taking the output and piping it into https://github.com/crickford/vue-json-schema-form and these are the changes I had to make for the output to play nicely.

@alecthomas
Copy link
Owner

Wouldn't it be also/more useful to fix vue-json-schema-form to support refs?

That said, seems like a fairly minimal change. Please fix the merge conflicts and squash your commits.

@tooolbox
Copy link
Contributor Author

tooolbox commented May 30, 2020

It works by passing chunks of the schema to child components as props, so it would have to "flesh out" the schema ahead of time. I suppose if I were pulling json schemas from sources I didn't control I would have thought of that first :)

(In either case, the functionality for this package is useful in itself.)

Merge conflicts? I don't see any, but maybe I'm missing something.

Also, you can choose to squash commits when accepting a PR, but sure.

@alecthomas
Copy link
Owner

GitHub tells me there are conflicts. You probably not to rebase onto master.

@tooolbox
Copy link
Contributor Author

Screen Shot 2020-05-29 at 11 30 54 PM

Strange...

@alecthomas
Copy link
Owner

Yes I'm fairly aware I can do a squash merge, but I prefer not to if possible.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants