ToolHub
中文
Light
GitHub
返回首页
/
数据格式
/
Schema 转 OpenAPI / Protobuf
加载中...
载入示例
清空输入
JSON Schema 输入
{ "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "active": { "type": "boolean" }, "count": { "type": "integer" }, "tags": { "type": "array", "items": { "type": "string" } } }, "required": ["id", "name"] }
字段数
5
必填数
2
OpenAPI 输出
复制
{ "openapi": "3.1.0", "info": { "title": "GeneratedPayload API", "version": "1.0.0" }, "components": { "schemas": { "GeneratedPayload": { "type": "object", "properties": { "id": { "type": "string" }, "name": { "type": "string" }, "active": { "type": "boolean" }, "count": { "type": "integer" }, "tags": { "type": "array", "items": { "type": "string" } } }, "required": [ "id", "name" ] } } } }
Protobuf 输出
复制
syntax = "proto3"; message GeneratedPayload { string id = 1; string name = 2; bool active = 3; int64 count = 4; repeated string tags = 5; }