No description
  • Go 99.8%
  • Makefile 0.2%
Find a file
Service Account - Terraform Provider DevEx 3bb8151a29 [CI] Update lock workflow file
2025-12-15 21:54:34 +01:00
.changes Update changelog 2024-01-19 21:01:15 +00:00
.github [CI] Update lock workflow file 2025-12-15 21:54:34 +01:00
cmd/tfplugingen-openapi Switch dependency mitchell/cli to hashicorp/cli (#112) 2023-12-21 09:43:01 -05:00
internal Replace tenv and exportloopref linters with usetesting and copyloopvar (#232) 2025-02-26 18:07:42 -05:00
META.d Add catalog metadata (META.d) (#248) 2025-05-13 08:19:24 -04:00
tools Bump golang.org/x/net from 0.33.0 to 0.36.0 in /tools (#238) 2025-03-24 11:45:20 -04:00
.changie.yaml [CI] terraform-devex-repos automation 2024-06-07 16:22:52 -04:00
.copywrite.hcl Add catalog metadata (META.d) (#248) 2025-05-13 08:19:24 -04:00
.gitignore Update binary name to tfplugingen-openapi (#54) 2023-09-19 08:25:13 -04:00
.golangci.yml Replace tenv and exportloopref linters with usetesting and copyloopvar (#232) 2025-02-26 18:07:42 -05:00
.goreleaser.yml SEC-090: Automated trusted workflow pinning (2025-02-03) (#222) 2025-02-03 12:55:33 -05:00
CHANGELOG.md Update changelog 2024-01-19 21:01:15 +00:00
DESIGN.md Add support for common parameters for resources and data sources (#114) 2024-01-16 10:44:39 -05:00
go.mod Bump github.com/pb33f/libopenapi from 0.21.5 to 0.21.8 (#233) 2025-03-07 16:15:33 -05:00
go.sum Bump github.com/pb33f/libopenapi from 0.21.5 to 0.21.8 (#233) 2025-03-07 16:15:33 -05:00
LICENSE [COMPLIANCE] Add copyright and license headers (#7) 2023-06-05 09:46:50 -04:00
Makefile Add support for string-able multi-types, allOf overrides, and improve error messaging (#63) 2023-10-12 11:56:01 -04:00
README.md Add issue templates and external links for feedback + questions (#95) 2023-11-22 11:06:19 -05:00

OpenAPI Provider Spec Generator

Terraform Provider Code Generation is currently in tech preview. If you have general questions or feedback about provider code generation, please create a new topic in the Plugin Development Community Forum.

Overview

The OpenAPI Provider Spec Generator is a CLI tool that transforms an OpenAPI 3.x Specification (OAS) into a Provider Code Specification.

A Provider Code Specification can be used to generate Terraform Provider code, for example, with the Plugin Framework Code Generator.

Documentation

Full usage info, examples, and config file documentation live on the HashiCorp developer site: https://developer.hashicorp.com/terraform/plugin/code-generation/openapi-generator

For more in-depth details about the design and internals of the OpenAPI Provider Spec Generator, see DESIGN.md.

Usage

Installation

You install a copy of the binary manually from the releases tab, or install via the Go toolchain:

go install github.com/hashicorp/terraform-plugin-codegen-openapi/cmd/tfplugingen-openapi@latest

Generate

The primary generate command requires a generator config and an OpenAPI 3.x specification:

tfplugingen-openapi generate \
  --config <path/to/generator_config.yml> \
  --output <output/for/provider_code_spec.json> \
  <path/to/openapi_spec.json>

Examples

Example generator configs, OpenAPI specifications, and Provider Code Specification output can be found in the ./internal/cmd/testdata/ folder. Here is an example running petstore3, built from source:

go run ./cmd/tfplugingen-openapi generate \
	--config ./internal/cmd/testdata/petstore3/generator_config.yml \
	--output ./internal/cmd/testdata/petstore3/provider_code_spec.json \
	./internal/cmd/testdata/petstore3/openapi_spec.json

License

Refer to Mozilla Public License v2.0.

Experimental Status

By using the software in this repository (the "Software"), you acknowledge that: (1) the Software is still in development, may change, and has not been released as a commercial product by HashiCorp and is not currently supported in any way by HashiCorp; (2) the Software is provided on an "as-is" basis, and may include bugs, errors, or other issues; (3) the Software is NOT INTENDED FOR PRODUCTION USE, use of the Software may result in unexpected results, loss of data, or other unexpected results, and HashiCorp disclaims any and all liability resulting from use of the Software; and (4) HashiCorp reserves all rights to make all decisions about the features, functionality and commercial release (or non-release) of the Software, at any time and without any obligation or liability whatsoever.