Skip to content

Defining a field named type throws an unmarshal error #83

Description

@JazielGuerrero

Describe the bug
If I define a field named type and try to generate the CIDL the generator throws the error:

LOG Parsing CIDL...
ERROR unmarshal error the data type type is not a primitive, extended, user-defined or imported type.

To Reproduce

  1. Copy and paste your CIDL:
types:
  Test:
    fields:
      - name: type
        type: u32
  1. If applicable, copy and paste your business logic
    N/A
  2. If applicable, copy and paste in what context you are calling the client library functions
    N/A
  3. If applicable, copy and paste the generated code
    N/A

Expected behavior
To generate the code

Screenshots
N/A

Platform version:

  • CLI Version [e.g. v0.1.0]
  • GenService Version [e.g. v0.1.0]

Extension (mark with an X the extension):

  • Solana Native [x]
  • Solana Anchor [x]

Additional context
N/A

Metadata

Metadata

Labels

BugThis is an item that causes unwanted behaviorDoneThis has been merged to develop

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions