I am using the Django REST Framework.
When using the browsable API, after clicking on the OPTIONS
button, I see beautiful definitions of fields and allowed actions for the resource, for example this user resource below:
HTTP 200 OK
Content-Type: application/json
Vary: Accept
Allow: GET, PUT, PATCH, DELETE, HEAD, OPTIONS
{
"name": "XSpot User Detail",
"description": "",
"renders": [
"application/json",
"text/html"
],
"parses": [
"application/json",
"application/x-www-form-urlencoded",
"multipart/form-data"
],
"actions": {
"PUT": {
"url": {
"type": "field",
"required": false,
"read_only": true
},
"mail_sent": {
"type": "boolean",
"required": false,
"read_only": false,
"label": "mail sent"
},
"email": {
"type": "email",
"required": true,
"read_only": false,
"label": "email address",
"max_length": 255
}
}
}
}
QUESTION: are there any JS frameworks able to utilize this meta information to generate forms?
Django REST framework is a powerful and flexible toolkit for building Web APIs. Some reasons you might want to use REST framework: The Web browsable API is a huge usability win for your developers.
The browsable API feature in the Django REST framework generates HTML output for different resources. It facilitates interaction with RESTful web service through any web browser. To enable this feature, we should specify text/html for the Content-Type key in the request header.
Django is the web development framework in python whereas the Django Rest Framework is the library used in Django to build Rest APIs. Django Rest Framework is especially designed to make the CRUD operations easier to design in Django. Django Rest Framework makes it easy to use your Django Server as an REST API.
Well i think this could be helpful http://formly-js.github.io/angular-formly this takes JSON and renders a HTML form.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With