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.scala — AnonymousTypeProtoLike.maybeAsAnonymousType
Problem
maybeAsAnonymousTypeinAnonymousTypeProtoLikeusesmapon thetypefield, which causes aMatchErrorwhen the field contains an unrecognized value like"ref". Per the Pulumi schema spec, when$refis present thetypefield 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 thetypefield contained"ref"alongside a$reffield.Current fix
Changed
maptocollectinmaybeAsAnonymousTypeso unrecognized type values returnNoneinstead 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.scala—AnonymousTypeProtoLike.maybeAsAnonymousType