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
d2f22ac3
Verified
Commit
d2f22ac3
authored
1 year ago
by
Daniel Hornung
Browse files
Options
Downloads
Patches
Plain Diff
ENH: Using OrderedDict for dictionaries of properties.
parent
0af91939
No related branches found
No related tags found
2 merge requests
!89
ENH: JsonSchemaExporter accepts do_not_create parameter.
,
!83
ENH: JsonSchemaExporter can merge schemata and arrayize them
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/caosadvancedtools/json_schema_exporter.py
+3
-2
3 additions, 2 deletions
src/caosadvancedtools/json_schema_exporter.py
with
3 additions
and
2 deletions
src/caosadvancedtools/json_schema_exporter.py
+
3
−
2
View file @
d2f22ac3
...
...
@@ -23,6 +23,7 @@
"""
from
typing
import
Any
,
List
,
Optional
from
collections
import
OrderedDict
import
linkahead
as
db
from
linkahead.common.datatype
import
get_list_datatype
,
is_list_datatype
...
...
@@ -113,7 +114,7 @@ class JsonSchemaExporter:
return
self
.
_make_text_property
(
prop
.
description
,
text_format
,
text_pattern
)
json_prop
=
{}
json_prop
=
OrderedDict
()
if
prop
.
description
:
json_prop
[
"
description
"
]
=
prop
.
description
if
self
.
_units_in_description
and
prop
.
unit
:
...
...
@@ -224,7 +225,7 @@ class JsonSchemaExporter:
schema
[
"
required
"
]
=
self
.
_make_required_list
(
rt
)
schema
[
"
additionalProperties
"
]
=
self
.
_additional_properties
props
=
{}
props
=
OrderedDict
()
if
self
.
_name_and_description_in_properties
:
props
[
"
name
"
]
=
self
.
_make_text_property
(
"
The name of the Record to be created
"
)
props
[
"
description
"
]
=
self
.
_make_text_property
(
...
...
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