Skip to content

UndeclaredCommonTypes error should always report fully qualfied name of type #580

@john-h-kastner-aws

Description

@john-h-kastner-aws

Before opening, please confirm:

Bug Category

Schemas and Validation

Describe the bug

This error currently report the unqualified name of the missing type when type isn't qualified in the schema source code.

This can be confusing if the type does exist, but in a different namespace.

For example, the error for the following schema is UndeclaredCommonTypes({"id"}), but id does exist in the empty namespace (#579 covers updating schema parsing to use this definition). It would be much more clear why this is an issue if the error specified that it couldn't find Demo::id.

{
  "Demo": {
    "entityTypes": {
      "User": {
        "memberOfTypes": [],
        "shape": {
          "type": "Record",
          "attributes": {
            "id": { "type": "id" },
          }
        }
      }
    },
    "actions": {}
  },
  "": {
    "commonTypes": {
      "id": {
        "type": "String"
      },
    }
    "entityTypes": {},
    "actions": {}
  }
}

Expected behavior

.

Reproduction steps

.

Code Snippet

// Put your code below this line.

Log output

// Put your output below this line

Additional configuration

No response

Operating System

No response

Additional information and screenshots

No response

Metadata

Metadata

Assignees

Labels

papercutSmall annoyances in the Cedar SDK. Lower priority fixes than bugs. Smaller than a feature request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions