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

MAINT: Template schema version and add dev schema url #942

Merged
merged 1 commit into from
Dec 31, 2024

Conversation

mferrera
Copy link
Collaborator

@mferrera mferrera commented Dec 23, 2024

Resolves #909
Opens #907

A little pre-work for setting up the inplace volumes product schema checking + schema versioning

@mferrera mferrera marked this pull request as ready for review December 23, 2024 08:25
@mferrera mferrera self-assigned this Dec 23, 2024
@mferrera mferrera force-pushed the adjust-schema-version branch from 3a28d6d to 2cf5358 Compare December 23, 2024 09:03
@@ -268,7 +270,7 @@ def generate(
) -> dict[str, Any]:
json_schema = super().generate(schema, mode=mode)
json_schema["$schema"] = self.schema_dialect
json_schema["$id"] = "fmu_results.json"
json_schema["$id"] = FmuResultsSchema.url()
Copy link
Contributor

Choose a reason for hiding this comment

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

Is it correct that the id is set to a url?

Copy link
Collaborator Author

@mferrera mferrera Dec 31, 2024

Choose a reason for hiding this comment

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

For a top-level schema, yep: ref.. Not the best naming...

Incidentally, this value is overwritten here anyway:

cat "$file" | jq '.["$id"]='\""$id"\" > "$sdir"/"$ffile"

But I'm hoping to make this a little more explicit in the code and eventually remove this shell script patch

Copy link
Contributor

@slangeveld slangeveld left a comment

Choose a reason for hiding this comment

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

Looks good 👍 One question above regarding the jsonSchema["$id"].

@mferrera mferrera merged commit 1370241 into equinor:main Dec 31, 2024
15 checks passed
@mferrera mferrera deleted the adjust-schema-version branch December 31, 2024 05:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Schema versioning: set fmu_results.json $id to the url it's hosted on
2 participants