Skip to content

Validate metadata input against schema  #73

Description

@psiemens

Freshmint should return helpful errors to the user when they pass metadata values that do not match the defined schema, specifically:

  • A metadata object that is missing one or more fields
  • A metadata object that includes values that do not match the specified field types (e.g. passing a non-integer value for Int)

Right now, incorrect metadata usually causes errors like this when forming the FCL transaction:

Type Error: Expected String for type String

Activity

  1. self-assigned this
    on Aug 27, 2022
  2. psiemens commented on Oct 21, 2022

    @psiemens
    ContributorAuthor

    The CLI panics when the CSV file provided to fresh mint does not contain header names that match the schema in freshmint.yaml:

    ? Create NFTs using data from editions.csv? Yes
    
    ⠋ Checking for duplicate NFTs ...
    TypeError [ERR_INVALID_ARG_TYPE]: The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object. Received undefined
        at new NodeError (node:internal/errors:371:5)
        at Function.from (node:buffer:323:9)
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions