Is there a JSON equivalent of xsd.exe?

I can generate XSD to build MyDataContract.dll using xsd.exe

xsd.exe MyDataContract.dll 

This will create a schema0.xsd with definitions for all assembly types.

Is there any equivalent for JSON?

I looked at the Newtonsoft Json.NET schema, but it only looks like an API, not an executable. In addition, it works at the “type” level, without being able to generate a JSON schema for all assembly types.

I would like to generate a JSON schema as part of my CI assembly.

I suppose I can create a console application using Json.Net Schema with reflection, etc., to achieve this, but it is surprising that such a program no longer exists.

+5
source share
1 answer

If you have a web API project, you might consider adding Swashbuckle, it can generate a swagger scheme (now called OpenAPI, I think) and it can generate a nice interface:

On nuget: https://www.nuget.org/packages/Swashbuckle/

Specifications: https://swagger.io/specification/

https://github.com/domaindrivendev/Swashbuckle

Not sure if this helps when you need a command line tool.

0
source

Source: https://habr.com/ru/post/1273435/


All Articles