Make use of Angular Schema Form to edit the request body
guillemcanal opened this issue · 3 comments
Basically, Angular Schema Form turn JSON Schemas into forms.
Since Swagger use a subset of JSON Schema to describe request and response bodies, it can be trivial to implement.
The tricky part is to handle content negociation properly on the request side of things. In fact, a Swagger definition may be converted into JSON, XML or into form "urlencoded" data depending on the consumes
property.
BTW, nice work ;)
@guillemcanal OK, schema related idea sounds reasonable, but "Angular Schema Form", at first sight seems to be defined as "Schema Form is a set of AngularJS directives (and a couple of services) to generate Bootstrap 3 ready forms from a JSON Schema." and we do not use Bootstrap 3 here so it is probably unrelated, am I right?
BTW, thanks!
I have to confess that I'm not very fluent in Angular but SchemaForm seems to be very close to the json-editor library, which is the one used by the original swagger-ui.
Regarding Bootstrap 3, It seems that the library support Material UI: https://github.com/json-schema-form/angular-schema-form-material
@guillemcanal thanks for explanation, there is similar way the form is generated, by template https://github.com/darosh/angular-swagger-ui-material/blob/master/src/modules/detail/request/parameter.html , but you probably had some missing feature in mind when you wrote this, had you? what was it?