Generates OpenAPI Interfaces for all the REST services and API objects within a Deployment Unit whose Generate OpenAPI interface property is enabled at the object level.
False |
No OpenAPI documentation will be generated. Default value. |
True |
Generate OpenAPI documentation for all REST services and API objects enabled in the deployment unit. |
Scope
Generators: .NET, Java
Level: Deploy Target Options
Description
This property is found at the Deploy Target Options level when the Local value is set in the Target.
This property facilitates the generation of OpenAPI interfaces for all REST services and API objects within a Deployment Unit object.
When this property is enabled, all objects within the Deployment Unit are expected to have the same configuration enabled. That is, the Generate OpenAPI interface property enabled at the object level.
If any object does not have this property enabled, an error will be generated indicating that all objects in the Deployment Unit must have the Generate OpenAPI interface property set to 'Yes'. Alternatively, you can set this property at the Generator level and perform a complete rebuild to correct the problem.
It is important to note that if the Deployment Unit does not include any REST objects and the property is enabled, an error will be generated indicating that the Deployment Unit does not include any Web Services. This highlights the need to ensure that all objects within the Deployment Unit are configured correctly.
Once the generation is successful, a file named “deploy.api.yaml” is created in the deploy directory. In addition, the value of the OPEN_API_VERSION variable is taken from the model, ensuring consistency with the OpenAPI version used in the project.
In the .NET Generator, the generated YAML file is included in the deploy directory but is not packaged inside the .NET deploy ZIP file.
In the case of Java Generator, the generated YAML file remains in the deploy directory and is not included in the WAR file.
MSBuild task
The MSBuild to run is located at <GeneXus Installation>\DeploymentTargets\Local\deploy.msbuild.
The property GXDeployFileProject indicates the location of the .gxdproj file generated at the createdeploy MSBuild task. See Application Deployment MSBuild tasks.
Example
MSBuild.exe /nologo /verbosity:minimal /ToolsVersion:4.0 "c:\GeneXus\DeploymentTargets\Local\deploy.msbuild"
/p:GENERATE_OPEN_API_INTERFACE="True"
/p:GX_PROGRAM_DIR= "c:\GeneXus"
/p:GXDeployFileProject="c:\GeneXus\kb\JavaModel\web\kbJavaEnvironmentDeploy1.gxdproj"
/t:Deploy
This solution is extensible and available at DeploymentTargets github.
Availability
This property is available since GeneXus 18 Upgrade 10.