Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
CaosDB Crawler
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 Crawler
Commits
581f68bd
Commit
581f68bd
authored
5 months ago
by
Alexander Schlemmer
Browse files
Options
Downloads
Patches
Plain Diff
DOC(validator): improved docstr of helper function
parent
62cc17ae
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!217
TST: Make NamedTemporaryFiles Windows-compatible
,
!201
Validator that checks created records using a json schema
Pipeline
#58337
passed
5 months ago
Stage: info
Stage: setup
Stage: cert
Stage: style
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/caoscrawler/validator.py
+11
-1
11 additions, 1 deletion
src/caoscrawler/validator.py
with
11 additions
and
1 deletion
src/caoscrawler/validator.py
+
11
−
1
View file @
581f68bd
...
...
@@ -67,7 +67,17 @@ def load_json_schema_from_datamodel_yaml(filename: str) -> list:
def
representer_ordereddict
(
dumper
,
data
):
# yaml.add_representer(OrderedDict, caoscrawler.validator.representer_ordereddict)
"""
Helper function to be able to represent the converted json schema objects correctly as yaml.
This representer essentially replaced OrderedDict objects with simple dict objects.
Since Python 3.7 dicts are ordered by default, see e.g.: https://softwaremaniacs.org/blog/2020/02/05/dicts-ordered/en/
Example how to use the representer:
```python
yaml.add_representer(OrderedDict, caoscrawler.validator.representer_ordereddict)
```
"""
return
dumper
.
represent_data
(
dict
(
data
))
...
...
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