Skip to content

Normalize uri keys of JsonSchemaFactory.jsonMetaSchemas on read and write #834

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

Merged
merged 1 commit into from
Jun 28, 2023

Conversation

stacywsmith
Copy link
Contributor

@stacywsmith stacywsmith commented Jun 27, 2023

Fixes #832

Previously, when writing to the JsonSchemaFactory.jsonMetaSchemas hash map, the uri key was not normalized, but upon reading from the hash map, the key was normalized.

In addition, if a key is not found in this hash map, the standard meta schema for the uri is loaded.

The result was that an attempt to augment a standard meta schema with custom formatters did not work because the standard meta schema was always used instead of the custom augmented meta schema.

This change normalizes the uri keys of JsonSchemaFactory.jsonMetaSchemas on both read and write. Normalizing the uri keys on both reads and writes also eliminates the need for the forceHttps and removeEmptyFragmentSuffix arguments to the normalizeMetaSchemaUri() method.

…h read and write.

Previously, when writing to the JsonSchemaFactory.jsonMetaSchemas hash map, the
uri key was not normalize, but upon reading from the hash map, the key was normalized.

In addition, if a key is not found in this hash map, the standard meta schema for the uri
is loaded.

The result was that an attempt to augment a standard meta schema with custom formatters did
not work because the standard meta schema was always used instead of the custom augmented
meta schema.

This change normalizes the uri keys of JsonSchemaFactory.jsonMetaSchemas on both read and write.
Normalizing the uri keys on both reads and writes also eliminates the need for the
forceHttps and removeEmptyFragmentSuffix arguments to the normalizeMetaSchemaUri() method.
@stevehu stevehu requested a review from fdutton June 27, 2023 22:23
@stevehu stevehu merged commit b1572db into networknt:master Jun 28, 2023
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.

Custom Formats not evaluated
3 participants