没有合适的资源?快使用搜索试试~ 我知道了~
schemars:从Rust代码生成JSON模式文档
共232个文件
rs:100个
json:86个
md:22个
需积分: 10 1 下载量 129 浏览量
2021-05-13
19:00:53
上传
评论
收藏 157KB ZIP 举报
温馨提示
原理图 从Rust代码生成JSON模式文档 基本用法 如果您不太在乎具体细节,则为您的类型生成JSON模式的最简单方法是#[derive(JsonSchema)]并使用schema_for! 宏。 该类型的所有字段还必须实现JsonSchema -Schemars为许多标准库类型实现了此功能。 use schemars :: {schema_for, JsonSchema}; #[derive(JsonSchema)] pub struct MyStruct { pub my_int: i32 , pub my_bool: bool , pub my_nullable_enum: Option < MyEnum> , } #[derive(JsonSchema)] pub enum MyEnum { StringNewType ( String ),
资源推荐
资源详情
资源评论
收起资源包目录
schemars:从Rust代码生成JSON模式文档 (232个子文件)
Gemfile 1KB
.gitattributes 40B
.gitignore 320B
.gitignore 76B
.gitignore 69B
.gitignore 30B
404.html 449B
schema.json 28KB
schema-2019_09.json 28KB
schema-openapi3.json 27KB
enum-adjacent-tagged-duf.json 3KB
enum-adjacent-tagged.json 3KB
enum-external-duf.json 2KB
enum-external.json 2KB
enum-internal-duf.json 2KB
enum-internal.json 2KB
doc_comments.schema.json 2KB
doc_comments.schema.json 2KB
range.json 2KB
result.json 2KB
schema_with-enum-adjacent-tagged.json 2KB
from_value_openapi3.json 1KB
from_value_2019_09.json 1KB
from_value_draft07.json 1KB
main.schema.json 1KB
main.schema.json 1KB
custom_settings.schema.json 1KB
custom_settings.schema.json 1KB
schema_with-enum-external.json 1KB
enum-untagged-duf.json 1KB
enum-untagged.json 1KB
inline-subschemas-recursive.json 1KB
duration_and_systemtime.json 1KB
remote_derive_generic.json 1KB
os_strings.json 1KB
remote_derive.json 968B
schemars_attrs.schema.json 955B
serde_attrs.schema.json 955B
schemars_attrs.schema.json 955B
serde_attrs.schema.json 955B
schema_with-enum-internal.json 950B
doc_comments_enum.json 919B
deprecated-enum.json 843B
default.json 819B
from_json_value.json 793B
schema-name-default.json 784B
schema-name-custom.json 767B
remote_derive.schema.json 764B
remote_derive.schema.json 764B
chrono-types.json 744B
doc_comments_struct.json 695B
doc_comments_struct_ref_siblings.json 651B
nonzero_ints.json 616B
schema_with-enum-untagged.json 566B
transparent-struct.json 551B
examples.json 545B
search-data.json 530B
flatten.json 506B
custom_serialization.schema.json 478B
custom_serialization.schema.json 478B
bytes.json 461B
doc_comments_override.json 433B
indexmap.json 426B
property-name-struct.json 423B
skip_enum_variants.json 419B
skip_struct_fields.json 412B
macro_built_enum.json 409B
from_value.schema.json 393B
from_value.schema.json 393B
inline-subschemas.json 391B
struct-normal-additional-properties.json 386B
deprecated-struct.json 360B
struct-normal.json 353B
schema_with-struct.json 331B
either.json 322B
crate_alias.json 319B
struct-tuple.json 317B
macro_built_struct.json 310B
schema_with-tuple.json 284B
skip_tuple_fields.json 249B
url.json 221B
arrayvec.json 201B
enum-repr-with-attrs.json 197B
enum-repr.json 149B
enum_repr.schema.json 149B
enum_repr.schema.json 149B
smallvec.json 146B
struct-newtype.json 122B
uuid.json 117B
schema_with-transparent-newtype.json 103B
schema_with-newtype.json 101B
arrayvec_string.json 99B
struct-unit.json 95B
LICENSE 1KB
LICENSE 10B
LICENSE 10B
CHANGELOG.md 10KB
1.1-attributes.md 9KB
README.md 7KB
2-implementing.md 3KB
共 232 条
- 1
- 2
- 3
资源评论
摔了个呆萌
- 粉丝: 28
- 资源: 4676
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功