Skip to content

Modular schema libraries (avoid hardcoding the base URI) #966

Closed
@jayrbolton

Description

@jayrbolton

I realize similar issues to this have come up before (eg here). I also realize this may be more of an implementation issue. If there is a better place to move this post, let me know. Basically, I want to avoid hardcoding any base URI references in a schema in order to better control dependencies in different environments (not unlike imports in a programming language).

A more concrete example:

  • I have a login form frontend that uses json-schema for form validation
  • I have a database server that uses json-schema for request validation
  • I have a repo of json-schemas that I want to reuse in both places (let's call it the "schema-lib")
  • In both the UI and the backend, I want to reference both local schemas and schemas from our schema-lib
  • I have multiple deployments of the UI, the server, and the schema-lib (eg test, staging, production)
  • When referencing schemas from the schema-lib, we need a configurable base URI that will change based on our environment
  • (It would also be useful to configure and use multiple base URIs)

Here are a couple proposed solutions (both very much in the implementation layers):

Side note: ideally, I would want to avoid any hard dependencies on http URLs to third party servers if I want the application to still work in a few years

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions