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

Default value for BO4E-Versions without _version #23

Merged
merged 1 commit into from
Dec 4, 2023
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,6 @@ dmypy.json
# vscode settings
.vscode/

src/_bo4e_python_generator_version.py
src/_bo4e_generator_version.py

unittests/output
5 changes: 4 additions & 1 deletion src/bo4e_generator/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,7 @@ def get_version(namespace: dict[str, SchemaMetadata]) -> str:
Get the version of the bo4e schemas.
"""
# The chosen class is arbitrary. All bo's and com's should contain the same version information.
return namespace["Angebot"].schema_parsed["properties"]["_version"]["default"]
try:
return namespace["Angebot"].schema_parsed["properties"]["_version"]["default"]
except KeyError:
return "unknown"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doofe Frage, aber wir sind ja aktuell deutsch unterwegs im BO4E Standard. Macht es dann Sinn den Default-Wert auch deutsch zu setzen?

Copy link
Collaborator Author

@lord-haffi lord-haffi Dec 1, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also bisher waren z.B. alle doc strings, die technischer Natur waren, in Englisch. Und ich persönlich halte gerne alles in Englisch, was geht.
Hier geht es nur um einen Version-string, siehe hier: https://github.com/Hochfrequenz/intermediate-bo4e-migration-models/blob/22acb2fef03cf808b75a5e4ea2ea0673418b3f75/src/ibims/bo4e/__version__.py