Does someone know the what mkSchemaDefinitions accomplishes and how it accomplishes it? Lars calls it boilerplate code, but now that I'm having an issue with it I have no idea how to fix it. I'll attach the error message along with my relevant code.

    • No instance for (Schema.ToSchema MintParams)
        arising from a use of ‘Playground.Schema.endpointsToSchemas’
    • In the expression:
          @((.\/) (Endpoint "mint" MintParams) (Endpoint "sell" SellParams))
      In an equation for ‘schemas’:
            = Playground.Schema.endpointsToSchemas
                @((.\/) (Endpoint "mint" MintParams) (Endpoint "sell" SellParams))
180 | mkSchemaDefinitions ''RoyaltySchema
type RoyaltySchema =
            Endpoint "mint" MintParams
        .\/ Endpoint "sell" SellParams
mkSchemaDefinitions ''RoyaltySchema
mkKnownCurrencies []
data MintParams = MintParams
    { name :: !TokenName
    , addr :: !Address
    } deriving (Generic, FromJSON, ToJSON, Show)
  • You should answer your own question rather than simply commenting that you fixed it.
    – gRebel
    Mar 15, 2022 at 3:23

1 Answer 1


I was able to fix this issue by adding ToSchema to the deriving statement

  • Would be good to add the actual statement change as code, not just describe it.
    – gRebel
    Mar 18, 2022 at 3:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.