hashicorp / terraform-plugin-codegen-spec

Terraform Provider Code Generation Specification and Go Bindings
Mozilla Public License 2.0
7 stars 4 forks source link

feat: add "description", "markdown_description", and "deprecation_message" to resource, provider, and data source schemas #92

Closed SKalt closed 3 months ago

SKalt commented 4 months ago

Addresses #81.

These added fields were copied more or less verbatim from the schemas in github.com/hashicorp/terraform-plugin-framework:

I chose to include both fields partially to simplify generating github.com/hashicorp/terraform-plugin-framework code, but I only need MarkdownDescription for my purposes: openapi v3.x.x fields should be interpreted as markdown (see https://spec.openapis.org/oas/v3.0.3#rich-text-formatting, https://spec.openapis.org/oas/v3.1.0#rich-text-formatting).

This change should be a minor change, adding functionality without affecting any existing code. Notably, this change doesn't check that the markdown_description field is valid to avoid any risk of breaking existing code.

I also held off touching any versioning. I'd be happy to handle that if you'd like to bump to 0.2!

hashicorp-cla commented 4 months ago

CLA assistant check
All committers have signed the CLA.

austinvalle commented 4 months ago

We do also have some documentation that is (frustratingly 😆) not in this repository, if you're so inclined to make an additional PR displaying these new fields: https://github.com/hashicorp/terraform-docs-common/blob/9989eba3efb29bf2a7d060d7f42a6dce993fbd2e/website/docs/plugin/code-generation/specification.mdx#L89-L92

SKalt commented 4 months ago

Hi @austinvalle! I pushed the missing sections of the JSON schema and tests (good catch!). I'm not sure when/if I'll get to updating the docs, since I'm getting pulled away for other work.

SKalt commented 3 months ago

Hey again @austinvalle, are there any blockers for this PR now that I've added the deprecation_messages?

austinvalle commented 3 months ago

I'll release the Go module with a v0.1.1, although we haven't ironed out the versioning for the schema, but since it's additive we can come back and bump that version if needed.

github-actions[bot] commented 1 month ago

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions. If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.