Skip to content

Entity deserialization error when using { "__entity" : { "type": "...", "id": "..." } } syntax #347

Description

@kostyantynv

Before opening, please confirm:

Bug Category

Other

Describe the bug

Entities.parse(Path)

fails with

Exception in thread "main" com.fasterxml.jackson.databind.JsonMappingException: com.cedarpolicy.model.exception.InvalidValueDeserializationException: "type" or "id" not found

If the entities json specification uses "__entity: { "type" : "...", "id": "..." }" syntax to specify parent entities. If the same syntax is used within attr no such error is generated.

Using cedar-java 4.8.0

entities.json

Expected behavior

Entities object allocated

Reproduction steps

Entities.parse(Path)

Code Snippet

import com.cedarpolicy.model.entity.Entities;
import java.nio.file.Path;

public class App {
    public static void main(String[] args) throws Exception {
        Entities.parse(Path.of("entities.json"));
    }
}

Log output

// Put your output below this line

Additional configuration

No response

Operating System

Linux

Additional information and screenshots

No response

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpending-triageHasn't been triaged yet

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions