Skip to content

Codegen: unrecognized type values in AnonymousTypeProtoLike crash schema deserialization #590

@lbialy

Description

@lbialy

Problem

maybeAsAnonymousType in AnonymousTypeProtoLike uses map on the type field, which causes a MatchError when the field contains an unrecognized value like "ref". Per the Pulumi schema spec, when $ref is present the type field should be ignored, but besom's codegen crashes instead.

This was hit when fetching the latest version of upstream provider schemas (e.g. google-native) where the type field contained "ref" alongside a $ref field.

Current fix

Changed map to collect in maybeAsAnonymousType so unrecognized type values return None instead of crashing. This is correct per the spec but means we silently ignore type information we don't understand.

Follow-up

We should investigate whether there are type values beyond the known primitives (string, integer, number, boolean, array, object) that carry meaningful semantics we should handle, rather than silently skipping.

Location

codegen/src/PulumiPackage.scalaAnonymousTypeProtoLike.maybeAsAnonymousType

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/codegenSchema to code generator

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions