Operation "delete" is not generating valid Typescript
See original GitHub issueWhat are the steps to reproduce this issue?
Orval: ^6.5.3 Type: react-query
I have a method called delete
and its not generating correctly.
OpenApiV3.json
"/authorization/{authorizationId}": {
"delete": {
"tags": [
"Authorization"
],
"summary": "Revoke authorization by ID",
"operationId": "delete_1",
"parameters": [
{
"name": "authorizationId",
"in": "path",
"description": "Id of Authorization to revoke",
"required": true,
"schema": {
"type": "integer",
"format": "int64"
}
}
],
"responses": {
"203": {
"description": "Revoked authorization"
},
"403": {
"description": "User not authorized to revoke"
},
"404": {
"description": "Authorization not found or previously revoked"
}
},
"security": [
{
"bearer-key": []
}
]
}
},
This is generating errors because delete is a reserved word for JSON.
Orval Config:
module.exports = {
authorization: {
output: {
mode: 'split',
target: 'src/query/endpoints/AuthorizationApi.ts',
schemas: 'src/query/model',
client: 'react-query',
mock: false,
},
input: {
target: './authorization-openapi.json',
},
},
};
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (9 by maintainers)
Top Results From Across the Web
What is the logic behind the TypeScript error "The operand of ...
/*When using the delete operator in strictNullChecks, the operand must now be any, unknown, never, or be optional (in that it contains undefined...
Read more >deleting a prop doesn't invalidate the interface #13783 - GitHub
Type casting should only be used to validate the delete operation. I.e. whether someObject would be valid if we assign it to an...
Read more >delete operator - JavaScript - MDN Web Docs - Mozilla
The delete operator removes a property from an object. If the property's value is an object and there are no more references to...
Read more >5 things you need to know about the delete operator in ...
In JavaScript, the delete operator is employed to delete a property of an object. After deleting the actual property, that property won't be ......
Read more >Documentation - TypeScript 4.0
For concat , the only valid thing we could do in older versions of the ... tuples and arrays even when we don't...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
PR https://github.com/anymaniax/orval/pull/314
I used the word
overriddenOperationName
instead ofoverrided
. But thanks for the suggested fix!Otherwise can simply be fixed with this but I am not a big fan of prefixing with a
_