-
-
Notifications
You must be signed in to change notification settings - Fork 242
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Render fields of a object when using MultipartFormField
#811
Comments
There are 2 bits to this - I've done the first on a branch (rendering_json_form_fields_as_objects). I have implemented your method of:
That gets us to your current situation - OA3 rendering appears as an object with no fields, but also adds a nice feature of being able to auto-marshall any String lens directly into a supported object - this can be: Query/Header/FormField/MPFF/EnvironmentKey. For the next bit - which might be a bit more tricky... making the OA3 renderer output the schema. Note it doesn't have the overall reflective object to use (because it loses the type when it marshalls into a string). But you could potentially get the same output as a JSON object schema without any optional fields (because as far as the renderer is concerned it does not know the optionality). For the moment, I've also made changes to introduce Feel free to have a play with this on the branch. Would be interested to hear your thoughts on the non-optionality. :) |
I've merged most of this into the master branch - there are no other changes currently - JSON fields are rendered as empty |
I've released this, but there are problems with adding extension functions to Companion objects which are not found on the classpath (in this case from
|
Could we use examples in the |
I've made a couple of changes to get nearer towards supporting this, but webform fields still don't have schemas yet. We should be able to get some JsonSchema there, but will not be able to get the automarshalling support of objects - , because the objects aren't available to MultipartFormBody or MultipartForm - it's just the list of fields (MultipartFormField) and files (MultipartFormFile) - the lenses sit on top of these objects. The kind of schema that we will be able to achieve eventually is the same that is output by the non-auto JSON implementations - ie. the things same format that comes out of JsonToJsonSchema, which works on the Json NODE object models. |
MultipartFormField
MultipartFormField
Currently
MultipartFormField.string().json()
renders in the openapi spec as atype: string
without any further context (even if you map theJsonObject
).mapWithNewMeta
+ParamMeta.Object
renders it as anobject
, but again with no information about the shape of the object.I would like to be able to
map
aMultipartFormField
and render the object in the schema with all of it's feilds. This is supported by the openapi spec and they even declare the default content type for these multipartobject
fields isapplication/json
.I would like this as I transfer a lot of files (and cannot take the base64 overhead and use json) as well as use codegen to generate a client to consume my API.
I would be more than happy to implement this myself. I would like to know if it's feasible and if so - some pointers on where to begin.
The text was updated successfully, but these errors were encountered: