Repository navigation
PATCH: Fix bugs in compiled schemas - #609
Open
mrshll1001 wants to merge 12 commits into
Open
mrshll1001 wants to merge 12 commits into
mrshll1001 wants to merge 12 commits into
Conversation
Refactored package schemas to directly reference the uncompiled schemas in the `schema/` directory. This is to ensure that they keep up to date with changes to these schemas without much need for manual updates.
Refactored compiled schemas into simple objects containing `$ref` which points to the uncompiled version. This was done to remove discrepancies between various compiled schemas and the uncompiled versions, as documented in various issues and threads. See https://forum.openreferral.org/t/compiled-schemas-considered-harmful/839/4 These could be subject to drift if not managed correctly, so replacing the dereferenced content with `$ref` ensures that any updates made to uncompiled schemas are simply carried through. This approach fixes the bugs, but keeps the URLs declared in the openapi.json file intact to avoid a MAJOR upgrade.
Refactored package schemas to directly reference the uncompiled schemas in the `schema/` directory. This is to ensure that they keep up to date with changes to these schemas without much need for manual updates.
Refactored compiled schemas into simple objects containing `$ref` which points to the uncompiled version. This was done to remove discrepancies between various compiled schemas and the uncompiled versions, as documented in various issues and threads. See https://forum.openreferral.org/t/compiled-schemas-considered-harmful/839/4 These could be subject to drift if not managed correctly, so replacing the dereferenced content with `$ref` ensures that any updates made to uncompiled schemas are simply carried through. This approach fixes the bugs, but keeps the URLs declared in the openapi.json file intact to avoid a MAJOR upgrade.
…ication into fix-compiled-schemas
Updated schema links to point to upcoming 3.3.2
Updated the URLs of schemas in openapi.json to point to upcoming 3.3.2
Ran hsds_schema docs-all to regenerate openapi30.json for the docs
Update validate examples test to reflect the new status of the compiled schemas
This commit adds the field `organization.services` to match the behaviour enacted by the HSDS Schema tools. This brings the organization schema in line with prior expectations set by the HSDS Schema tool's compilation step (i.e. adding in the organization.services property).
Refactored the test_examples_jsonschema workflow to directly use the `check-jsonschema` command added by the runner, rather than relying on the `validate_examples_json_schema.sh` script in the root directory. The script was failing because of the circular reference between organization and service schemas with `compiletojsonschema` reaching the limit of Python nesting. The `check-jsonschema` tool is more efficient at checking things, and now the test has been refactored to test each example directly against the appropriate schema. Noting here; it's currently not possible to test the "list" examples (.e.g `examples/organization_list.json`) due to the fact that they are structured according to the embedded `Page` schema; currently modelled in the `openapi.json` file. It may be worth extracting that later, to tidy everything up and keep it maintainable.
Updated Swagger UI to handle rendering of OAS 3.1. This should forgo the need to recompile/regenerate the `openapi.json` file specifically for the docs.
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.
Related issues
Description
This PR enacts the Technical Committee decision to manually refactor the compiled schemas to remove bugs.
This is achieved by updating a number of compiled schema files, replacing the contents with references to appropriate schemas in HSDS.
This means that they are kept up to date with HSDS development, but avoids needing a MAJOR upgrade to change the return schemas in the API Specification.
Merge checklist
If you have edited any schema files:
hsds_schema.pyto updatedatapackage.jsonand example filesIf you are working towards a new MINOR release:
$idvalues in schema files where appropriate$refvalues inopenapi.json