flexmeasures.api.common.schemas.utils

Functions

flexmeasures.api.common.schemas.utils.make_openapi_compatible(schema_cls: Type[Schema]) Type[Schema]

Create an OpenAPI-compatible version of a Marshmallow schema.

  • Drops custom __init__ args from the original schema

  • Replaces custom fields (like VariableQuantityField) with String

flexmeasures.api.common.schemas.utils.rst_to_openapi(text: str) str

Convert a string with RST markup to OpenAPI-safe text.

  • Replaces X with <abbr title=”Y”>X</abbr>

  • Converts \(base^{exp}\) into HTML sup/sub notation for OpenAPI

  • Removes any RST footnote references like [#]_ or [1]_ or [label]