Skip to content

A way to get the tfprotov5/6.Schema from schema.Schema #1237

@magodo

Description

@magodo

I'm trying to create a (standalone) List Resource, in which case I have to implement the RawV(5|6)Schemas method. Basically, the logic is to new a resource, then call its .Schema() and .IdentitySchema(), and assign these schemas to the response of the method.

However, there isn't an obvious way to convert:

  • Resource schema schema.Schema to tfprotov5/6.Schema
  • Identity schema identityschema.Schema to tfprotov(5|6).ResourceIdentitySchema

On the other hand, the SDKv2 has those helper methods:

https://github.com/hashicorp/terraform-provider-azurerm/blob/d8bca21ec306ae6cfe48fa906700a4a1967222dc/vendor/github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema/core_schema.go#L404-L417

Does this mean to support List Resource under fw, the only option is to extend the Resource?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions