我正在使用Django REST框架.
使用可浏览的API时,单击OPTIONS按钮后,我会看到字段的美妙定义和资源允许的操作,例如下面的此用户资源:
使用可浏览的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表单.