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

Improve readability of context schema #687

Closed
Tracked by #604
mkuziemko opened this issue Mar 24, 2022 · 0 comments
Closed
Tracked by #604

Improve readability of context schema #687

mkuziemko opened this issue Mar 24, 2022 · 0 comments
Assignees
Labels
area/cli Relates to CLI area/hub Relates to Hub area/hub-manifests Relates to Hub manifests enhancement New feature or request
Milestone

Comments

@mkuziemko
Copy link

mkuziemko commented Mar 24, 2022

Description

The goal of this task is to:

  • change type of storage contextSchema from string to object,
  • make appropriate changes in hub-js, create a unit test
  • update hub-manifests
  • make sure that the creation of test-storage-backend works fine.

Reason

Currently, we defined context schema for storage backends as a const string as in this example, but it is not readable and error-prone.
As in the above example, it would be better to have:

{
      "$schema": "http://json-schema.org/draft-07/schema",
      "type": "object",
      "required": [
        "provider"
      ],
      "properties": {
        "provider": {
          "$id": "#/properties/context/properties/provider",
          "type": "string",
          "enum": [
            "aws_secretsmanager",
            "dotenv"
          ]
        }
      },
      "additionalProperties": false
    }

instead of:

\n\t{\n      \"$schema\": \"http://json-schema.org/draft-07/schema\",\n      \"type\": \"object\",\n      \"required\": [\n        \"provider\"\n      ],\n      \"properties\": {\n        \"provider\": {\n          \"$id\": \"#/properties/context/properties/provider\",\n          \"type\": \"string\",\n          \"enum\": [\n            \"aws_secretsmanager\",\n            \"dotenv\"\n          ]\n        }\n      },\n      \"additionalProperties\": false\n    }\n

Related issues

#604

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/cli Relates to CLI area/hub Relates to Hub area/hub-manifests Relates to Hub manifests enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants