Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Allow clashing types ref (controlled via Reflector.NamesWithPkg option) #107

Closed

Conversation

candiduslynx
Copy link
Contributor

No description provided.

@candiduslynx candiduslynx changed the title feat: Allow clashing types ref feat: Allow clashing types ref (controlled via Reflector.NamesWithPkg option) Oct 3, 2023
@candiduslynx candiduslynx marked this pull request as draft October 3, 2023 16:53
@candiduslynx candiduslynx marked this pull request as ready for review October 3, 2023 17:59
@candiduslynx
Copy link
Contributor Author

candiduslynx commented Oct 3, 2023

@samlown this just allows the schema to use advanced names.
Additionally, the pkg path is escaped to be a valid JSON pointer.

I've successfully tested (via https://pkg.go.dev/github.com/santhosh-tekuri/jsonschema/v5) the resulting schema for testdata.Odd with the following input:

{
  "dummy1": {"A":"str"},
  "dummy2": {"B":12345}
}

An alternative to this could be replacing all / & ~ symbols with underscores or defined char, but it'll be prone to clash in the following case:

root
⌞_ pkg
   ⌞_ another_pkg
⌞_ pkg_another
   ⌞_ pkg

P.S.: using . instead of / & ~ might just work, though

@candiduslynx
Copy link
Contributor Author

@samlown I propose reviewing this one before #106, as this will make the diff for #106 much shorter & easier to review

@candiduslynx
Copy link
Contributor Author

Replaced by #109

@candiduslynx candiduslynx deleted the feat/full-pkg-path-for-id branch October 6, 2023 09:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant