Class OpenApiNamespaceResolver

java.lang.Object
io.quarkiverse.openapi.generator.deployment.template.OpenApiNamespaceResolver
All Implemented Interfaces:
io.quarkus.qute.NamespaceResolver, io.quarkus.qute.Resolver, io.quarkus.qute.WithPriority

public class OpenApiNamespaceResolver extends Object implements io.quarkus.qute.NamespaceResolver
Collection of OpenAPI specific methods to use in the templates. It can be enhanced to have even more methods. See the usage of the method #genDeprecatedModelAttr to understand how to implement and use them.
  • Method Details

    • genDeprecatedModelAttr

      public boolean genDeprecatedModelAttr(String pkg, String classname, HashMap<String,Object> codegenConfig)
      Parameters:
      pkg - name of the given package
      classname - name of the Model class
      codegenConfig - Map with the model codegen properties
      Returns:
      true if the given model class should generate the deprecated attributes
    • genDeprecatedApiAttr

      public boolean genDeprecatedApiAttr(String pkg, String classname, HashMap<String,Object> codegenConfig)
      Parameters:
      pkg - name of the given package
      classname - name of the Model class
      codegenConfig - Map with the model codegen properties
      Returns:
      true if the given model class should generate the deprecated attributes
    • parseUri

      public String parseUri(String uri)
    • hasAuthMethods

      public boolean hasAuthMethods(org.openapitools.codegen.model.OperationMap operations)
    • getUniqueOAuthOperations

      public List<org.openapitools.codegen.CodegenSecurity> getUniqueOAuthOperations(List<org.openapitools.codegen.CodegenSecurity> oauthOperations)
      Ignore the OAuth flows by filtering every oauth instance by name. The inner openapi-generator library duplicates the OAuth instances per flow in the openapi spec. So a specification file with more than one flow defined has two entries in the list. For now, we do not use this information in runtime so it can be safely filtered and ignored.
      Parameters:
      oauthOperations - passed through the Qute template
      Returns:
      The list filtered by unique auth name
      See Also:
      • "resources/templates/libraries/microprofile/auth/compositeAuthenticationProvider.qute"
    • resolve

      public CompletionStage<Object> resolve(io.quarkus.qute.EvalContext context)
      Specified by:
      resolve in interface io.quarkus.qute.Resolver
    • getNamespace

      public String getNamespace()
      Specified by:
      getNamespace in interface io.quarkus.qute.NamespaceResolver