Skip to content

Commit

Permalink
refactor: create more references
Browse files Browse the repository at this point in the history
  • Loading branch information
pvaneveld committed Jun 22, 2024
1 parent f12db10 commit 7873b71
Show file tree
Hide file tree
Showing 3 changed files with 143 additions and 98 deletions.
72 changes: 39 additions & 33 deletions openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1502,21 +1502,51 @@ components:
description: The numeric id of the original space
required:
- space
Modification:
type: object
properties:
display:
type: string
enum:
- hide
required:
type: boolean
ValidatedObject:
type: object
properties:
type:
type: string
enum:
- field
field_key:
type: string
field_attr:
type: string
enum:
- value
RuleCondition:
type: object
properties:
validated_object:
$ref: '#/components/schemas/ValidatedObject'
validation:
type: string
enum:
- empty
- not_empty
- equals
- not_equals
value:
type: string
nullable: true
ConditionalSettings:
type: object
properties:
modifications:
type: array
description: List of modifications to be applied to the field. Only 1 modification can be applied at a time (hide OR required)
items:
type: object
properties:
display:
type: string
enum:
- hide
required:
type: boolean
$ref: '#/components/schemas/Modification'
rule_match:
description: Define if all or any of the conditions should be met to apply the modifications
type: string
Expand All @@ -1527,31 +1557,7 @@ components:
description: Conditional rules to be applied to the field
type: array
items:
type: object
properties:
validated_object:
type: object
properties:
type:
type: string
enum:
- field
field_key:
type: string
field_attr:
type: string
enum:
- value
validation:
type: string
enum:
- empty
- not_empty
- equals
- not_equals
value:
type: string
nullable: true
$ref: '#/components/schemas/RuleCondition'
FieldOption:
type: object
properties:
Expand Down
87 changes: 48 additions & 39 deletions sbmgmt/main.gen.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

82 changes: 56 additions & 26 deletions schemas/components.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -332,13 +332,7 @@ ConditionalSettings:
type: array
description: "List of modifications to be applied to the field. Only 1 modification can be applied at a time (hide OR required)"
items:
type: object
properties:
display:
type: string
enum: [hide]
required:
type: boolean
$ref: "#/Modification"
rule_match:
description: "Define if all or any of the conditions should be met to apply the modifications"
type: string
Expand All @@ -347,22 +341,58 @@ ConditionalSettings:
description: "Conditional rules to be applied to the field"
type: array
items:
type: object
properties:
validated_object:
type: object
properties:
type:
type: string
enum: [field]
field_key:
type: string
field_attr:
type: string
enum: [value]
validation:
type: string
enum: [empty, not_empty, equals, not_equals]
value:
type: string
nullable: true
$ref: "#/RuleCondition"


Modification:
type: object
properties:
display:
type: string
enum: [hide]
required:
type: boolean

Properties:
type: object
properties:
component:
$ref: "#/Component"
fields:
type: array
items:
$ref: "#/Field"
total:
type: integer
format: int64
description: The total number of components
cursor:
type: string
description: The cursor to continue from
has_more:
type: boolean
description: Whether there are more components to fetch

RuleCondition:
type: object
properties:
validated_object:
$ref: "#/ValidatedObject"
validation:
type: string
enum: [empty, not_empty, equals, not_equals]
value:
type: string
nullable: true

ValidatedObject:
type: object
properties:
type:
type: string
enum: [field]
field_key:
type: string
field_attr:
type: string
enum: [value]

0 comments on commit 7873b71

Please sign in to comment.