Skip to content

Support minimum and maximum properties in JSON Schema output#377

Merged
sujaypatil96 merged 2 commits intomainfrom
spatil/json-schema-min-max
Sep 29, 2021
Merged

Support minimum and maximum properties in JSON Schema output#377
sujaypatil96 merged 2 commits intomainfrom
spatil/json-schema-min-max

Conversation

@sujaypatil96
Copy link
Copy Markdown
Member

@sujaypatil96 sujaypatil96 commented Sep 28, 2021

This PR seeks to handle the accommodation of minimum and maximum properties in the JSON Schema output, when values are specified in the LinkML schema, like such:

id: https://w3id.org/linkml/examples/personinfo
name: personinfo
prefixes:
  linkml: https://w3id.org/linkml/
imports:
  - linkml:types
default_range: string

classes:
  Person:
    attributes:
      id:
        identifier: true     ## unique key for a person
      full_name:
        required: true       ## must be supplied
        description:
          name of the person
      aliases:
        multivalued: true    ## range is a list
        description:
          other names for the person
      phone:
        pattern: "^[\\d\\(\\)\\-]+$"   ## regular expression
      age:
        range: integer       ## an int between 0 and 200
        minimum_value: 0
        maximum_value: 200
  Container:
    attributes:
      persons:
        multivalued: true
        inlined_as_list: true
        range: Person

Merging this PR will resolve issue #376.

@sujaypatil96 sujaypatil96 linked an issue Sep 28, 2021 that may be closed by this pull request
@sujaypatil96 sujaypatil96 added this to the 2021-12-01 milestone Sep 28, 2021
@sujaypatil96 sujaypatil96 added the bug Something that should work but isn't, with an example and a test case. label Sep 28, 2021
@sujaypatil96 sujaypatil96 merged commit 9e3f5bc into main Sep 29, 2021
@sujaypatil96 sujaypatil96 deleted the spatil/json-schema-min-max branch October 5, 2021 18:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something that should work but isn't, with an example and a test case.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

maximum/minumum value not translated into json schema

2 participants