javascript – JS Framework能够基于(django)rest api OPTIONS生成表单

前端之家收集整理的这篇文章主要介绍了javascript – JS Framework能够基于(django)rest api OPTIONS生成表单前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我正在使用Django REST框架.
使用可浏览的API时,单击OPTIONS按钮后,我会看到字段的美妙定义和资源允许的操作,例如下面的此用户资源:
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","read_only": false,"label": "mail sent"
            },"email": {
                "type": "email","required": true,"label": "email address","max_length": 255
            }
        }
    }
}

问题:是否有任何JS框架能够利用此元信息生成表单?

解决方法

嗯,我认为这可能是有用的 http://formly-js.github.io/angular-formly这需要JSON并呈现HTML表单.

猜你在找的JavaScript相关文章