Open belljun3395 opened 2 months ago
Related Isssue: #105 , #205
I am not good at English. If there's anything you don't understand, please leave a comment.
I know swagger and postman support file type.
- Swagger
- Postman
So I wrote the code to implement to support request with file.
private data class RequestModel( .... val requestParts: List<OperationRequestPart>, )
Add requestParts for multipart request.
requestParts
class FileSchema( builder: BinarySchemaBuilder ) : StringSchema(builder) { ... val format: String }
@JsonPropertyOrder({ "key", "type", "src", "description", }) public class FormData { .... }
Make FileSchema/FormData for OpenApiGenerator/PostmanGenerator to handle spec for file type.
FileSchema/FormData
OpenApiGenerator/PostmanGenerator
In Generator they are added to RequestModel and Body
RequestModel
Body
data class RequestModel( ... // FileSchema -> RequestPartFieldDescriptor val requestParts: List<RequestPartFieldDescriptor>, )
@JsonPropertyOrder({ "mode", "raw", "urlencoded", "formdata" }) public class Body { ... }
Related Isssue: #105 , #205
I am not good at English. If there's anything you don't understand, please leave a comment.
I know swagger and postman support file type.
- Swagger
- Postman
So I wrote the code to implement to support request with file.
RequestModel
Add
requestParts
for multipart request.FileSchema, FormData
Make
FileSchema/FormData
forOpenApiGenerator/PostmanGenerator
to handle spec for file type.In Generator they are added to
RequestModel
andBody