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

Use Quarkus Extension OpenAPI Client gen II: adding metadata annotations

XMLWordPrintable

    • 2022 Week 14-16 (from Apr 4)

      Quarkiverse open api extension currently generate a set of classes and methods.

      Serverless workflow parser needs to generate code to invoke the right class and method by using function definition (uri of the open api file and  operation id) and function arguments (a json object),  being specified in the flow definition file.

      In order to do that, the following annotations needs to  be added to the code generated by the extension:

      • OpenApiService, at class level. Attributes of the annotaion should be a required source URI from where the class was generated from and an optional tag (tag might be present or not in the openapi file, the extension generate a class per tag in the file). This will be used by Workflow parser to identify the class from the service uri.
      • OpenApiOperation, at method level, with following attributes:  the operationid as in the open api file, plus the type of the generated pojo class that will contain the body  of this request (this will only be present for post/put method request). This will be used by Workflow parser to identify the java method using the operation id and the type of the pojo instance to be build from function args
      • OpenApiParam, per method argument. One optional attribute, the parameter name as specified in the open api file. Please also note that name is enough, we do not really care if the parameter is a path, query or header one (thats part of the the internal logic of the generated code). We need this annotation to be able to map function arguments in flow file (identified by a name)  to java class method parameters. All names in the json argument object which do no have a corresponding annotation will be considered part of the body and will be used to build the pojo identified with OpenApiOperation. The POJO argument itself does not need to be annotated

            ftirados Francisco Javier Tirado Sarti
            ftirados Francisco Javier Tirado Sarti
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: