### Install Markserv Source: https://openapi-generator.tech/docs/new-generator Install the markserv tool globally to serve markdown files for previewing. ```bash npm install --global markserv ``` -------------------------------- ### Install OpenJDK with Scoop Source: https://openapi-generator.tech/docs/installation Installs OpenJDK using the Scoop Java bucket, which may be required if Java is not already installed. ```bash scoop bucket add java scoop install openjdk ``` -------------------------------- ### Example Java YAML Configuration with Libraries Source: https://openapi-generator.tech/docs/customization A sample YAML configuration for Java, equivalent to the JSON example. It specifies project coordinates and the HTTP client library. ```yaml groupId: "com.my.company" artifactId: "MyClient" artifactVersion: "1.2.0" library: "feign" ``` -------------------------------- ### Generate Ruby Client with Homebrew Source: https://openapi-generator.tech/docs/installation Generates a Ruby client from a petstore.yaml document after installing with Homebrew. ```bash openapi-generator generate -i petstore.yaml -g ruby -o /tmp/test/ ``` -------------------------------- ### Generate Samples with Configuration Source: https://openapi-generator.tech/docs/new-generator Execute this script to generate samples using the specified configuration file. ```bash ./bin/generate-samples.sh bin/configs/common-mark-documentation-petstore-new.yaml ``` -------------------------------- ### Install Custom Generator with Maven Source: https://openapi-generator.tech/docs/customization Install your custom generator library to the local Maven repository using 'mvn clean install'. This makes it available as a dependency for other projects. ```bash mvn clean install -f out/generators/my-codegen ``` -------------------------------- ### Run Integration Tests for Samples Source: https://openapi-generator.tech/docs/contributing Execute integration tests for client samples using Maven. A local instance of the Petstore server is required. ```shell mvn integration-test -f samples/client/petstore/python/pom.xml ``` -------------------------------- ### Assemble Project with Gradle Source: https://openapi-generator.tech/docs/templating This command navigates to the generated client's directory and assembles the project using Gradle. This step is used to verify that the custom template compiles correctly. ```bash cd ~/.openapi-generator/example gradle assemble ``` -------------------------------- ### Display Help Information Source: https://openapi-generator.tech/docs/usage Use the `help` option to list all available commands for the CLI. This provides an overview of the generator's capabilities. ```bash openapi-generator-cli help ``` -------------------------------- ### Gradle Task Dependency Example Source: https://openapi-generator.tech/docs/plugins Example of how to make other tasks depend on the 'openApiGenerate' task. ```gradle compileJava.dependsOn tasks.named("openApiGenerate") ``` -------------------------------- ### Install OpenAPI Generator with Homebrew Source: https://openapi-generator.tech/docs/installation Installs the OpenAPI Generator using the Homebrew package manager on macOS. ```bash brew install openapi-generator ``` -------------------------------- ### Generate Client with Custom Options Source: https://openapi-generator.tech/docs/online This example shows how to POST to the generation endpoint with a JSON body that includes custom options for SDK customization. The `options` object can be used to fine-tune the generated code. ```bash { "options": {}, "openAPIUrl": "https://raw.githubusercontent.com/openapitools/openapi-generator/master/modules/openapi-generator/src/test/resources/3_0/petstore.yaml" } ``` -------------------------------- ### Example JSON Configuration Source: https://openapi-generator.tech/docs/customization An example JSON configuration file for the OpenAPI generator. This snippet shows how to set the 'apiPackage' option. ```json { "apiPackage" : "petstore" } ``` -------------------------------- ### Install OpenAPI Generator CLI with Scoop Source: https://openapi-generator.tech/docs/installation Installs the OpenAPI Generator CLI tool using the Scoop package manager on Windows. ```bash scoop install openapi-generator-cli ``` -------------------------------- ### Display General Config Help Source: https://openapi-generator.tech/docs/usage Shows the general help information for the config-help command, including available options and their descriptions. This provides an overview of how to use the command. ```bash openapi-generator-cli help config-help ``` -------------------------------- ### Example Output for New Generator Creation Source: https://openapi-generator.tech/docs/new-generator Illustrates the expected output when the `new.sh` script is used to create a new documentation generator. ```text Creating modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CommonMarkDocumentationCodegen.java Creating modules/openapi-generator/src/main/resources/common-mark-documentation/README.mustache Creating modules/openapi-generator/src/main/resources/common-mark-documentation/model.mustache Creating modules/openapi-generator/src/main/resources/common-mark-documentation/api.mustache Creating bin/configs/common-mark-documentation-petstore-new.yaml Finished. ``` -------------------------------- ### Install OpenAPI Generator CLI with PyPI Source: https://openapi-generator.tech/docs/installation Installs the OpenAPI Generator CLI tool using pip from PyPI. A Java executable is required. ```bash pip install openapi-generator-cli ``` -------------------------------- ### Install OpenAPI Generator CLI as Dev Dependency with npm Source: https://openapi-generator.tech/docs/installation Installs the OpenAPI Generator CLI tool as a development dependency in your current project. ```bash npm install @openapitools/openapi-generator-cli -D ``` -------------------------------- ### Assemble Project with Gradle Source: https://openapi-generator.tech/docs/templating Execute this command to assemble the project using the Gradle wrapper. ```bash ./gradlew assemble ``` -------------------------------- ### Install Bash Launcher Script Source: https://openapi-generator.tech/docs/installation Copies the launcher script to a local directory, makes it executable, and adds it to the system's PATH. ```bash mkdir -p ~/bin/openapitools curl https://raw.githubusercontent.com/OpenAPITools/openapi-generator/master/bin/utils/openapi-generator-cli.sh > ~/bin/openapitools/openapi-generator-cli chmod u+x ~/bin/openapitools/openapi-generator-cli export PATH=$PATH:~/bin/openapitools/ ``` -------------------------------- ### Example YAML Configuration Source: https://openapi-generator.tech/docs/customization An example YAML configuration file for the OpenAPI generator. This snippet demonstrates the equivalent of the JSON configuration for setting 'apiPackage'. ```yaml apiPackage: "petstore" ``` -------------------------------- ### Install Specific OpenAPI Generator CLI Version with npm Source: https://openapi-generator.tech/docs/installation Installs a specific version of the OpenAPI Generator CLI tool. Ensure you have the desired version number. ```bash openapi-generator-cli version-manager set 7.22.0 ```