Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
caosdb-advanced-user-tools
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
caosdb
Software
caosdb-advanced-user-tools
Commits
884e9a55
Verified
Commit
884e9a55
authored
1 year ago
by
Daniel Hornung
Browse files
Options
Downloads
Patches
Plain Diff
MAINT: renamed parameter in json_schema_exporter
parent
cd9459b2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!89
ENH: JsonSchemaExporter accepts do_not_create parameter.
,
!84
F more jsonschema export
Pipeline
#43330
failed
1 year ago
Stage: setup
Stage: cert
Stage: style
Stage: unittest
Stage: integrationtest
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/caosadvancedtools/json_schema_exporter.py
+22
-22
22 additions, 22 deletions
src/caosadvancedtools/json_schema_exporter.py
with
22 additions
and
22 deletions
src/caosadvancedtools/json_schema_exporter.py
+
22
−
22
View file @
884e9a55
...
...
@@ -36,8 +36,8 @@ class JsonSchemaExporter:
"""
def
__init__
(
self
,
additional_properties
:
bool
=
True
,
name_
for_new_reference
_records
:
bool
=
False
,
description_
for_new_reference
_records
:
bool
=
False
,
name_
property_for_new
_records
:
bool
=
False
,
description_
property_for_new
_records
:
bool
=
False
,
additional_options_for_text_props
:
dict
=
None
,
units_in_description
:
bool
=
True
,
do_not_create
:
List
[
str
]
=
None
,
...
...
@@ -51,12 +51,12 @@ class JsonSchemaExporter:
additional_properties : bool, optional
Whether additional properties will be admitted in the resulting
schema. Optional, default is True.
name_
for_new_reference
_records : bool, optional
Whether objects
t
ha
t are
genera
ted from reference properties shall have a `name`
property in the generated schema.
Optional, default is False.
description_
for_new_reference
_records : bool, optional
Whether objects
t
ha
t are
genera
ted from reference properties shall have a `description`
property in the generated schema.
Optional, default is False.
name_
property_for_new
_records : bool, optional
Whether objects
s
ha
ll
genera
lly have a `name` property in the generated schema.
Optional, default is False.
description_
property_for_new
_records : bool, optional
Whether objects
s
ha
ll
genera
lly have a `description` property in the generated schema.
Optional, default is False.
additional_options_for_text_props : dict, optional
Dictionary containing additional
"
pattern
"
or
"
format
"
options for
string-typed properties. Optional, default is empty.
...
...
@@ -84,8 +84,8 @@ class JsonSchemaExporter:
do_not_retrieve
=
[]
self
.
_additional_properties
=
additional_properties
self
.
_name_
for_new_reference_records
=
name_for_new_reference
_records
self
.
_description_
for_new_reference
_records
=
description_
for_new_reference
_records
self
.
_name_
property_for_new_records
=
name_property_for_new
_records
self
.
_description_
property_for_new
_records
=
description_
property_for_new
_records
self
.
_additional_options_for_text_props
=
additional_options_for_text_props
self
.
_units_in_description
=
units_in_description
self
.
_do_not_create
=
do_not_create
...
...
@@ -256,9 +256,9 @@ class JsonSchemaExporter:
schema
[
"
additionalProperties
"
]
=
self
.
_additional_properties
props
=
OrderedDict
()
if
self
.
_name_
for_new_reference
_records
:
if
self
.
_name_
property_for_new
_records
:
props
[
"
name
"
]
=
self
.
_make_text_property
(
"
The name of the Record to be created
"
)
if
self
.
_description_
for_new_reference
_records
:
if
self
.
_description_
property_for_new
_records
:
props
[
"
description
"
]
=
self
.
_make_text_property
(
"
The description of the Record to be created
"
)
...
...
@@ -303,8 +303,8 @@ class JsonSchemaExporter:
def
recordtype_to_json_schema
(
rt
:
db
.
RecordType
,
additional_properties
:
bool
=
True
,
name_
for_new_reference
_records
:
bool
=
False
,
description_
for_new_reference
_records
:
bool
=
False
,
name_
property_for_new
_records
:
bool
=
False
,
description_
property_for_new
_records
:
bool
=
False
,
additional_options_for_text_props
:
Optional
[
dict
]
=
None
,
units_in_description
:
bool
=
True
,
do_not_create
:
List
[
str
]
=
None
,
...
...
@@ -324,12 +324,12 @@ def recordtype_to_json_schema(rt: db.RecordType, additional_properties: bool = T
additional_properties : bool, optional
Whether additional properties will be admitted in the resulting
schema. Optional, default is True.
name_
for_new_reference
_records : bool, optional
Whether objects
t
ha
t are
genera
ted from reference properties shall have a `name`
property in the generated schema. Optional,
default is False.
description_
for_new_reference
_records : bool, optional
Whether objects
t
ha
t are
genera
ted from reference properties shall have a `description`
property in the generated schema.
Optional, default is False.
name_
property_for_new
_records : bool, optional
Whether objects
s
ha
ll
genera
lly have a `name` property in the generated schema. Optional,
default is False.
description_
property_for_new
_records : bool, optional
Whether objects
s
ha
ll
genera
lly have a `description` property in the generated schema.
Optional, default is False.
additional_options_for_text_props : dict, optional
Dictionary containing additional
"
pattern
"
or
"
format
"
options for
string-typed properties. Optional, default is empty.
...
...
@@ -358,8 +358,8 @@ def recordtype_to_json_schema(rt: db.RecordType, additional_properties: bool = T
exporter
=
JsonSchemaExporter
(
additional_properties
=
additional_properties
,
name_
for_new_reference_records
=
name_for_new_reference
_records
,
description_
for_new_reference
_records
=
description_
for_new_reference
_records
,
name_
property_for_new_records
=
name_property_for_new
_records
,
description_
property_for_new
_records
=
description_
property_for_new
_records
,
additional_options_for_text_props
=
additional_options_for_text_props
,
units_in_description
=
units_in_description
,
do_not_create
=
do_not_create
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment