Skip to content

Improve readability of context schema  #687

@mkuziemko

Description

@mkuziemko

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions