Comments (18)
from ts-openapi.
It is not a good practice to use array directly in the body, but inside an object
from ts-openapi.
thanks for your quick respond, but the doc says
ALWAYS RETURN JSON WITH AN OBJECT ON THE OUTSIDE
Always have the outside primitive be an object for JSON strings¶
but we're talking about request body, is there anything inappropriate to send an array as request body?
from ts-openapi.
https://www.ibm.com/docs/en/urbancode-build/6.1.2?topic=reference-rest-api-conventions
from ts-openapi.
from ts-openapi.
I'm afraid we have misunderstanding here. It seems I'm talking about when request body schema is in Array, it has an error, while you're talking about it's not a good idea to send Array back client side. Right?
Sorry about that.
Let me clearify my situation.
I'm working on a tool to work with an internal Koa framwork to generate swagger api doc.
Here -> https://github.com/Zsynuting/ts-swagger-doc
So, I use ts-openapi to generate JSON schema and then use swagger-ui-koa to consume the JSON schema and serve swagger doc.
But when I describe a POST request body an Array, there happened the exception above.
See sample at line 32.
https://github.com/Zsynuting/ts-swagger-doc/blob/main/sample/controller.ts
from ts-openapi.
from ts-openapi.
Can we have a call today?
from ts-openapi.
Sure, how about 10:00 PM China time, how would you like to do the call?
from ts-openapi.
meet.google.com/jjn-obkr-hpn in around 2h45
from ts-openapi.
got it
from ts-openapi.
https://github.com/Zsynuting/ts-openapi-issue/blob/main/src/index.ts
just find out if according to ts type constraint, I can't replicate the issue. but I still think my case is considerable. please check it out.
from ts-openapi.
working on it, but expect a few days to solve it
from ts-openapi.
FYI finishing my tests, should be ready in a day or two, sorry for the delay, but between work and holidays, haven't had much time available.
from ts-openapi.
cool! No problem, just take your time.
from ts-openapi.
check version 1.1.0 please
from ts-openapi.
it works perfect, thanks man!
from ts-openapi.
Closing issue then. Thanks.
from ts-openapi.
Related Issues (10)
- Only one method per path HOT 3
- Ability to declare other request methods HOT 9
- Add model defination HOT 2
- bodySchema not exported? HOT 5
- Enum in response schema HOT 1
- ES6 Maps and Sets HOT 3
- Array of arrays not implemented HOT 1
- Schema/models usage HOT 1
- Example parameter not being exported for responses HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ts-openapi.