Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Treat empty blocks with MinItems == 0 as optional #99

wants to merge 2 commits into from


Copy link

@ovandriyanov ovandriyanov commented Dec 2, 2021

This patch allows for generating documentation for those providers which have empty objects in their schema, i.e, the objects with no attributes and no nested blocks.

Terraform allows providers to have empty objects in their schema, but currently terraform-plugin-docs does not recognize such empty fields neither as required, nor optional, nor read-only, and thus cannot generate docs for such providers and raises an error like the following:

no match for empty_block_field, this can happen if you have incompatible schema
defined, for example an optional block where all the child attributes are
computed, in which case the block itself should also be marked computed

Fix it by handling such empty blocks explicitly.

Closes #100

Copy link

hashicorp-cla commented Dec 2, 2021

CLA assistant check
All committers have signed the CLA.

Copy link

GennadySpb commented Mar 16, 2022

@bflad Please check this PR: I got same issue as #100

@ovandriyanov ovandriyanov requested a review from a team as a code owner Mar 16, 2022
detro approved these changes Apr 26, 2022
Copy link

@detro detro left a comment

Sorry, erroneous approval.

This is good, but we need BUG FIXES entry added to the CHANGELOG

@detro detro added this to the v0.8.0 milestone Apr 26, 2022
Copy link

detro commented Apr 26, 2022

Sorry, I think I should have been more explicit.

The changelog format is defined here .

Your change will be part of 0.8.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet

Successfully merging this pull request may close these issues.

4 participants