Skip to content

Example Manifests formatted as JSON in the scraped provider metadata #29

Description

@ulucinar

What problem are you facing?

As discussed here, the scraped provider metadata document embeds converted (from HCL to JSON) resource example manifests as JSON strings:

...
              manifest: |-
                {
                  "country_code": "US",
                  "data_residency_location": "United States",
                  "display_name": "example-b2c-tenant",
                  "domain_name": "exampleb2ctenant.onmicrosoft.com",
                  "resource_group_name": "example-rg",
                  "sku_name": "PremiumP1"
                }

We can consider embedding them as YAML.

How could Terrajet help solve your problem?

As explained here, we hit some issues while doing so as this requires conversion from JSON to YAML and then back to JSON. Using sigs.k8s.io/yaml as the JSON2YAML convertor and as YAML encoder solves the tab character issue mentioned in that comment, as the sigs.k8s.io/yaml library does not encode the multiline YAML values with a preceding tab char as multiline YAML but rather a quoted (single-line) YAML string with special chars escaped. However, the JSON libraries cannot cope with the embedded map[interface{}]interface{} values by the YAML decoder (when unmarshaling from the provider doc to a map[string]interface{}. We can have a deeper look into this.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions