Пример #1
0
def _add_optional_props(api: DataService, es_hit: Mapping) -> None:
    api.description = {
        "nb":
        es_hit["content"].get("clean_description",
                              es_hit["content"]["description"])
    }
    try:
        api.endpointURL = es_hit["content"]["url"]
    except KeyError:
        pass

    if es_hit["content"].get("swagger", es_hit["content"].get("api_dec")):
        api.endpointDescription = es_hit["content"].get(
            "swagger", es_hit["content"].get("api_dec"))
Пример #2
0
def _add_optional_props(api: DataService, es_hit: Mapping) -> None:
    api.publisher = URI(os.environ["PUBLISHER"])
    api.description = {"nb": es_hit["content"]["description"]}
    api.endpointURL = es_hit["content"]["url"]
    api.endpointDescription = es_hit["content"]["swagger"]