Skip to content

Commit

Permalink
Add a wrapping @context tag to JSON-LD generator (#454)
Browse files Browse the repository at this point in the history
This patch is related to the [issue 386 of aas-specs]. We fix 
the JSON-LD generation so that the context can be served
directly at a given URL and digested in a JSON-LD document.

[issue 386 of aas-specs]: admin-shell-io/aas-specs#386
  • Loading branch information
ethieblin authored Mar 20, 2024
1 parent 94399e1 commit a35fd9a
Show file tree
Hide file tree
Showing 3 changed files with 2,783 additions and 2,778 deletions.
3 changes: 2 additions & 1 deletion aas_core_codegen/jsonld/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
This code has been originally developed by Fabien Amarger (murloc6),
Elodie Thieblin (ethieblin), and Christian Glomb (wiresio).
"""

import dataclasses
import json
from typing import (
Expand Down Expand Up @@ -382,7 +383,7 @@ def _generate(
if len(errors) > 0:
return None, errors

return Stripped(json.dumps(json_ld_context, indent=2)), None
return Stripped(json.dumps({"@context": json_ld_context}, indent=2)), None


def execute(context: run.Context, stdout: TextIO, stderr: TextIO) -> int:
Expand Down
Loading

0 comments on commit a35fd9a

Please sign in to comment.