Uploaded image for project: 'Kogito'
  1. Kogito
  2. KOGITO-6687

Provide alternate mechanism for OpenAPI call default property naming

XMLWordPrintable

    • False
    • False
    • Hide
      we are going to allow users to configure the configuration key to be used though usage of property kogito.sw.operationIdStrategy
      Possible values will be
       FILE_NAME (default, will take the last element of the spec uri path),
       FULL_URI (will generate the configkey from the full uri path)
       FUNCTION_NAME (will generate the config key from the workflow id and the function name that references the spec uri)
       SPEC_TITLE (will generate the config key from the spec title, as requested originally by this JIRA)

      Also, user will be able to specify the config key by using URI_DEFINITIONS extension
      Show
      we are going to allow users to configure the configuration key to be used though usage of property kogito.sw.operationIdStrategy Possible values will be  FILE_NAME (default, will take the last element of the spec uri path),  FULL_URI (will generate the configkey from the full uri path)  FUNCTION_NAME (will generate the config key from the workflow id and the function name that references the spec uri)  SPEC_TITLE (will generate the config key from the spec title, as requested originally by this JIRA) Also, user will be able to specify the config key by using URI_DEFINITIONS extension
    • 2022 Week 23-25 (from Jun 6), 2022 Week 26-28 (from Jun 27)

      In a sw.yaml when we specify a url for the OpenAPI spec, the url is used to determine the value needed to be used when specifying the security values for that services in the application.properties. So if we have a URL such as:

      https://raw.githubusercontent.com/fredsmith/sampleOpenAPISpec/main/customer.yaml#retrieveCustomerDetails

      https://raw.githubusercontent.com/fredsmith/sampleOpenAPISpec/main/customer.yaml#retrieveCustomerDetails
      then the id that is used in the properties is determined from the `customer.yaml` part and is `customer`, so the properties would be:

      org.kogito.openapi.client.customer.username=<username>
      org.kogito.openapi.client.customer.password=<password>

      so if we have a URL that doesn't point to an actual file but invokes a service which returns the OpenAPI spec, such as:

      https://my.remote.host/apicatalog/apis/{apiID}/document#myOperation

      or

      https://my.remote.host/apicatalog/apis/{apiName}/{apiVersion}/document#myOperation

      The value that needs to be used in the properties in the application.properties will be `document` {}(based on how the value is determined for the other URLs ) . This will cause issues in being able to specify auth details for the different OpenAPI specs as they will all return the same value `document`.

       

      We need a different method to determine the value that should be used in the application.properties for each of the OpenAPI requests.

      A suggestion was to use the `info.title` from the OpenAPI document (https://swagger.io/specification/#info-object).

      The usage of this alternate method could be made configurable via something in the application.properties, such as:

      org.kogito.openapi.gen.useTitleAsId=true

              ftirados Francisco Javier Tirado Sarti
              groeges Steven Groeger (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: