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

fix: specify a minimum length for the options of enum args #642

Merged
merged 2 commits into from
May 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
116 changes: 61 additions & 55 deletions text/simple_extensions_schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ properties:
type: string
structure:
$ref: "#/$defs/type"
parameters: # parameter list for compound types
parameters: # parameter list for compound types
$ref: "#/$defs/type_param_defs"
variadic: # when set, last parameter may be specified one or more times
variadic: # when set, last parameter may be specified one or more times
type: boolean
type_variations:
type: array
Expand Down Expand Up @@ -63,80 +63,86 @@ properties:
$defs:
type:
oneOf:
- type: string # any data type
- type: object # syntactic sugar for a non-nullable named struct
type_param_defs: # an array of compound type parameter definitions
- type: string # any data type
- type: object # syntactic sugar for a non-nullable named struct
type_param_defs: # an array of compound type parameter definitions
type: array
items:
type: object
required: [type]
properties:
name: # name of the parameter (for documentation only)
name: # name of the parameter (for documentation only)
type: string
description: # description (for documentation only)
description: # description (for documentation only)
type: string
type: # expected metatype for the parameter
type: # expected metatype for the parameter
type: string
enum:
- dataType
- boolean
- integer
- enumeration
- string
min: # for integers, the minimum supported value (inclusive)
min: # for integers, the minimum supported value (inclusive)
type: number
max: # for integers, the maximum supported value (inclusive)
max: # for integers, the maximum supported value (inclusive)
type: number
options: # for enums, the list of supported values
type: array
minItems: 1
uniqueItems: true
items:
type: string
optional: # when set to true, the parameter may be omitted at the end or skipped using null
options: # for enums, the list of supported values
$ref: "#/$defs/enum_options"
optional: # when set to true, the parameter may be omitted at the end or skipped using null
type: boolean
arguments: # an array of arguments
enum_options:
type: array
minItems: 1
uniqueItems: true
items:
type: string
enumeration_arg:
type: object
additionalProperties: false
required: [options]
properties:
name:
type: string
description:
type: string
options:
$ref: "#/$defs/enum_options"
value_arg:
type: object
required: [value]
properties:
name:
type: string
description:
type: string
value:
$ref: "#/$defs/type"
constant:
type: boolean
type_arg:
type: object
required: [type]
properties:
name:
type: string
description:
type: string
type:
type: string
arguments: # an array of arguments
type: array
items:
oneOf:
- type: object # enumeration
additionalProperties: false
required: [ options ]
properties:
name:
type: string
description:
type: string
options:
type: array
items:
type: string
- type: object # value
required: [ value ]
properties:
name:
type: string
description:
type: string
value:
$ref: "#/$defs/type"
constant:
type: boolean
- type: object # type
required: [ type ]
properties:
name:
type: string
description:
type: string
type:
type: string
options: # a map of options
- $ref: "#/$defs/enumeration_arg"
- $ref: "#/$defs/value_arg"
- $ref: "#/$defs/type_arg"
options: # a map of options
type: object
additionalProperties:
type: object # option
additionalProperties: false
required: [ values ]
required: [values]
properties:
description:
type: string
Expand Down Expand Up @@ -192,7 +198,7 @@ $defs:
items:
type: object
additionalProperties: false
required: [ return ]
required: [return]
properties:
args:
$ref: "#/$defs/arguments"
Expand Down Expand Up @@ -225,7 +231,7 @@ $defs:
items:
type: object
additionalProperties: false
required: [ return ]
required: [return]
properties:
args:
$ref: "#/$defs/arguments"
Expand Down Expand Up @@ -267,7 +273,7 @@ $defs:
items:
type: object
additionalProperties: false
required: [ return ]
required: [return]
properties:
args:
$ref: "#/$defs/arguments"
Expand Down
Loading