Skip to content

# OpenAPI translation

The `api_description_path` must point to the Publish API to be shared, and it should follow the ServiceAPIDescription schema.

This schema could be obtained by applying this code.

    import opencapif_sdk

    translator = opencapif_sdk.api_schema_translator("./path/to/openapi.yaml")
    translator.build("https://192.168.1.10:8080/exampleAPI/v1", "0", "0")

This code will read `openapi.yaml`, ensure the structure of it and translate the content into ServiceAPIDescription schema, then will create a .json named `api_description_name`. Also it is necessary to fill the ip and port fields to create correctly the schema. The supported_features and api_supp_features fields corresponds to the capabilities of the provider and the service that the user is sharing.