<p>I was able to fix this issue by adding <code>ToSchema</code> to the deriving statement</p>

CC BY-SA 4.0
2022-03-18T03:21:33.687Z
Would be good to add the actual statement change as code, not just describe it.
gRebel
CC BY-SA 4.0
2022-03-16T13:21:55.780Z
2022-03-16T13:21:55.780Z
Kyle Murphy
<p>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.</p>
<pre><code> error:
    • No instance for (Schema.ToSchema MintParams)
        arising from a use of ‘Playground.Schema.endpointsToSchemas’
    • In the expression:
        Playground.Schema.endpointsToSchemas
          @((.\/) (Endpoint &quot;mint&quot; MintParams) (Endpoint &quot;sell&quot; SellParams))
      In an equation for ‘schemas’:
          schemas
            = Playground.Schema.endpointsToSchemas
                @((.\/) (Endpoint &quot;mint&quot; MintParams) (Endpoint &quot;sell&quot; SellParams))
    |
180 | mkSchemaDefinitions ''RoyaltySchema
</code></pre>
<pre><code>type RoyaltySchema =
            Endpoint &quot;mint&quot; MintParams
        .\/ Endpoint &quot;sell&quot; SellParams
</code></pre>
<pre><code>mkSchemaDefinitions ''RoyaltySchema
mkKnownCurrencies []
</code></pre>
<pre><code>data MintParams = MintParams
    { name :: !TokenName
    , addr :: !Address
    } deriving (Generic, FromJSON, ToJSON, Show)
</code></pre>

CC BY-SA 4.0
2022-03-15T03:23:14.650Z
You should answer your own question rather than simply commenting that you fixed it.
gRebel
<plutus-pioneer-program>
mkSchemaDefinitions compilation error
# mkSchemaDefinitions compilation error

(Asked by: username_0 on 2022-03-02)

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.
 error:
    • No instance for (Schema.ToSchema MintParams)
        arising from a use of ‘Playground.Schema.endpointsToSchemas’
    • In the expression:
        Playground.Schema.endpointsToSchemas
          @((.\/) (Endpoint "mint" MintParams) (Endpoint "sell" SellParams))
      In an equation for ‘schemas’:
          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)

**Tags:** plutus-pioneer-program
> **Comments:**
> **username_1**: You should answer your own question rather than simply commenting that you fixed it.  

---

## 1 answers

### Answer by username_0 on 2022-03-16. Score: 1

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

> **Comments:**
> **username_1**: Would be good to add the actual statement change as code, not just describe it.  

---

