orval
orval copied to clipboard
bug: readonly fields missing from mutation function input types
What are the steps to reproduce this issue?
Minimal swagger.json
{
"swagger": "2.0",
"info": {
"title": "My API",
"version": "1.0"
},
"paths": {
"/thing/update": {
"post": {
"operationId": "UpdateThing",
"parameters": [
{
"name": "models.Thing",
"in": "body",
"required": true,
"schema": {
"type": "object",
"$ref": "#/definitions/models.Thing"
}
}
],
"responses": {
"200": {
"description": ""
}
}
}
}
},
"definitions": {
"models.ThingDescription": {
"type": "object",
"properties": {
"text": {
"type": "string"
}
}
},
"models.Thing": {
"type": "object",
"properties": {
"ThingDescriptions": {
"type": "array",
"items": {
"$ref": "#/definitions/models.ThingDescription"
},
"readOnly": true
}
}
}
}
}
What happens?
When calling the generated updateThing() function, the input body (modelsThing) is empty:
It looks like NonReadonly<T> is producing the incorrect type, thus breaking the types here
What were you expecting to happen?
modelsThing should have the correct type, not {}
What versions are you using?
Package Version: 6.25.0