I am able to generate an XSDs for MyDataContract.dll assembly using xsd.exe
我可以为MyDataContract生成一个XSDs。dll组件使用xsd.exe
xsd.exe MyDataContract.dll
This will generate an schema0.xsd with definitions for all the types in the assembly.
这将生成一个schema0。具有用于程序集中所有类型的定义的xsd。
Is there any equivalent for JSON?
JSON有对应的吗?
I've looked at Newtonsoft Json.NET Schema but this seems to only provide an API, not an executable. Additionally, it seems to work at the 'type' level, without being able to generate a JSON schema for all types in an assembly.
我看过Newtonsoft Json。NET模式,但这似乎只提供了一个API,而不是一个可执行程序。此外,它似乎可以在“type”级别上工作,而不能为程序集中的所有类型生成JSON模式。
I'd like to generate the JSON schema as part of my CI build.
我希望作为CI构建的一部分生成JSON模式。
I suppose I could build a console application using Json.Net Schema with reflection, etc. to achieve this, but it surprising no such program already exists.
我想我可以使用Json构建一个控制台应用程序。Net Schema和反射等实现了这一点,但令人惊讶的是还没有这样的程序存在。
1 个解决方案
#1
0
If you have a web API project, you could consider adding Swashbuckle, it can generate swagger schema (which is now called OpenAPI I believe) and can generate a nice UI:
如果您有一个web API项目,您可以考虑添加Swashbuckle,它可以生成swagger模式(现在称为OpenAPI),并可以生成一个漂亮的UI:
On nuget: https://www.nuget.org/packages/Swashbuckle/
nuget:https://www.nuget.org/packages/Swashbuckle/
Specifications: https://swagger.io/specification/
规格:https://swagger.io/specification/
https://github.com/domaindrivendev/Swashbuckle
https://github.com/domaindrivendev/Swashbuckle
Not sure if this helps as you wanted a command line tool.
不确定这是否有用,因为您需要一个命令行工具。
#1
0
If you have a web API project, you could consider adding Swashbuckle, it can generate swagger schema (which is now called OpenAPI I believe) and can generate a nice UI:
如果您有一个web API项目,您可以考虑添加Swashbuckle,它可以生成swagger模式(现在称为OpenAPI),并可以生成一个漂亮的UI:
On nuget: https://www.nuget.org/packages/Swashbuckle/
nuget:https://www.nuget.org/packages/Swashbuckle/
Specifications: https://swagger.io/specification/
规格:https://swagger.io/specification/
https://github.com/domaindrivendev/Swashbuckle
https://github.com/domaindrivendev/Swashbuckle
Not sure if this helps as you wanted a command line tool.
不确定这是否有用,因为您需要一个命令行工具。