Skip to content

refactor: remove need in ruby code to havetype declared in jsonschema that contains a const #636

@kbroch-rivosinc

Description

@kbroch-rivosinc

metasource jsonschema tool found following anti-pattern:

❯ jsonschema lint --ignore schemas/json-schema-draft-07.json schemas/.
/Users/kbroch/rvi/non-repo-repos/riscv-unified-db/schemas/manual_schema.json:
  Setting `type` alongside `const` is considered an anti-pattern, as the constant already implies its respective type (const_with_type)
    at schema location "/properties/$schema"
/Users/kbroch/rvi/non-repo-repos/riscv-unified-db/schemas/manual_schema.json:
  Setting `type` alongside `const` is considered an anti-pattern, as the constant already implies its respective type (const_with_type)
    at schema location "/properties/kind"
/Users/kbroch/rvi/non-repo-repos/riscv-unified-db/schemas/manual_version_schema.json:
  Setting `type` alongside `const` is considered an anti-pattern, as the constant already implies its respective type (const_with_type)
    at schema location "/properties/$schema"
/Users/kbroch/rvi/non-repo-repos/riscv-unified-db/schemas/manual_version_schema.json:
  Setting `type` alongside `const` is considered an anti-pattern, as the constant already implies its respective type (const_with_type)
    at schema location "/properties/kind"
error: Could not resolve the requested schema
  at tag:schema_defs.json

@dhower-qc said: #401 (comment)

We should be able to refactor code to derive "type = string" from the const and remove this anti-pattern from the schema files.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions