-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Allow references that don't start with #/definitions/ #1506
Conversation
That's tricky. The spec spec doesn't clarify I don't really want to get into putting stuff behind options, but maybe this should be? Create a new |
Looking at the spec, it seems like JSON schema does require that |
@edi9999 this PR should be ready for review -- could you please take a look? |
sorry, i don't have time right now, only after January 10th |
@edi9999 ? |
@edi9999 can you take a look at this PR? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure to be able to read this with a lot of things to say, but it looks good to me
* update package lock * v2.0.0-alpha.2 * Overridable DescriptionField in BooleanField (rjsf-team#1594) * Overridable description field in BooleanField * Adds test for BooleanField's overridable DescriptionField * doc: JSON schema version supported versions (rjsf-team#1603) For rjsf-team#1307 (comment) * Don't crash when schema property is a non-object - show an error instead (rjsf-team#1582) * don't throw TypeError: Cannot use 'in' operator to search for * Update Form_test.js Co-authored-by: Ashwin Ramaswami <[email protected]> * Set up CI with Azure Pipelines (rjsf-team#1605) * Set up CI with Azure Pipelines [skip ci] * Update azure-pipelines.yml for Azure Pipelines * Add npm test to azure pipelines * Delete .travis.yml * Combine all themes into a single playground (rjsf-team#1539) * move playground to new folder * move playground to packages and standardize playground structure * don't rely on bootstrap in playground * fix styling, move share button to top right * remove footer things * more fixes * encode theme in playground hash * fix: don't switch to default theme when changing tabs * correct package name is @rjsf/playground * fix prod config for playground * fix more configs * use webpack-dev-server * render form in a Frame * add dependencies * use DemoFrame component to properly fix material-ui styles * use old bootstrap look and feel for the playground itself * fix dist * move netlify toml * update netlify * empty commit * remove npm prepare to speed up travis runs * fix webpack dist config for playground * fix import * disable minicssextractplugin to try to fix netlify * fix netlify path * no need to build playground / gh-pages for core package * add HtmlWebpackPlugin * Allow references that don't start with #/definitions/ (rjsf-team#1506) * pass entire rootSchema to findSchemaDefinition, not just definitions * use jsonpointer to handle non-"#/definitions" definitions * revert package-lock * make sure json pointers are URI fragment encoded * replace "definitions" with "rootSchema" variable * Fix getMatchingOption logic * fix tests * remove console log * Fix tests * prettier * Remove support for recursive references to deep schema definitions * update docs for registry and definitions * add `definitions` back to registry * Fix mui form tests * Add a general registry test * update proptypes of registry * fix eslint issues * fix formatting * Fix local playground for core package (rjsf-team#1607) * remove scss file from playground * fix dev playground on @rjsf/core * fix playground version * update package-lock * fix playground "npm start" * chore: move docs to separate folder (rjsf-team#1604) * test: adding a github workflow for running tests Co-authored-by: Ashwin Ramaswami <[email protected]> Co-authored-by: Erik Lothe <[email protected]> Co-authored-by: ACoolmanBigHealth <[email protected]> Co-authored-by: Evgeniy Tatarkin <[email protected]> Co-authored-by: Chancellor Clark <[email protected]>
status
Ready for review. This PR introduces a few breaking changes:
rootSchema
, has been added to the registry.registry.definitions
is still available, though, to ease compatibility.original considerations
A few considerations:
#/definitions/
. However, JSON Pointer standard says that absolute definition URLs should start with something like/definitions/
-- the former is only the "URI Fragment Identifier" representation of the JSON Pointer. However, Swagger does it the former way (starting with #). Not sure which one is best for us to go with? In the future, we might also want to support relative JSON Pointers, which is a consideration too.Consider the following schema:
In the previous behavior (added in #556),
$ref: "#/definitions/testdef/properties/bar"
would actually resolve totype: "string"
. However, using the jsonpointer library, it says that this definition does not even exist.Perhaps I misunderstood the JSON Pointer spec when implementing #556 - maybe it's not supposed to resolve "recursive references to deep schema definitions". Is that the case, and if so, should we go by the standard or keep with our current implementation? (backwards compatibility isn't a huge issue as this will go into v2.0.0)
any thoughts @domharrington @erunion or others?