Docsright arrowBlackbirdright arrowGenerating Code with Blackbird

2 min • read

Generating Code with Blackbird

Get the APIs to production faster with generated code from various programming languages. Developers don’t need to manually write boilerplate code for each supported language. Instead, they can focus on implementing the core business logic.

Codegen using our Provided Template

First, download the sample petstore.yaml file to test with.

When using the provided template for Go projects, the following prompts will appear:

  • ProjectName: Provide a name for your new Go project. This will also be the name for the cmd in your project.
  • GoModule: Provide a name for your new Go project's go.mod module. For more information, read about Using Go Modules.
  • GoVersion: Provide the Go version for your project. This value will also be used in go.mod.
  • enable GitHub Actions - Test module?: Generate a .github/build.yaml configuring CI testing for the project using GitHub Actions.
  • enable Readme module? [y/n]: Generate a basic README.md file for the project.
  • enable Dockerfile module? [y/n]: Generate a basic Dockerfile to use with blackbird code run, blackbird code debug, and blackbird deployment create

Using a Local Template

To generate your code using a locally available template, pass the path to the template as an argument.

Codegen without using a Template

To just generate the OpenAPI Spec-based code, pass the argument to not use a template.