Json schema generator#
- class esgvoc.apps.jsg.json_schema_generator.JsonPropertiesVisitor(project_id: str)[source]#
- class esgvoc.apps.jsg.json_schema_generator.SetEncoder(*, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, sort_keys=False, indent=None, separators=None, default=None)[source]#
Bases:
JSONEncoder
- default(o)[source]#
Implement this method in a subclass such that it returns a serializable object for
o
, or calls the base implementation (to raise aTypeError
).For example, to support arbitrary iterators, you could implement default like this:
def default(self, o): try: iterable = iter(o) except TypeError: pass else: return list(iterable) # Let the base class default method raise the TypeError return super().default(o)
- esgvoc.apps.jsg.json_schema_generator.generate_json_schema(project_id: str) str [source]#
Generate json schema for the given project.
- Parameters:
project_id (str) – The id of the given project.
- Returns:
The content of a json schema
- Return type:
- Raises:
EsgvocNotFoundError – On missing information
EsgvocNotImplementedError – On unexpected operations