RicoSuter / NJsonSchema

JSON Schema reader, generator and validator for .NET
http://NJsonSchema.org
MIT License
1.39k stars 534 forks source link

Add support for comparing two NJsonSchema specifications #309

Open shwetap051 opened 7 years ago

shwetap051 commented 7 years ago

Do you have bandwidth to support comparing two NJsonSchema specifications and spew out the differences to determine whether a newer API specification is backwards-compatible with an older API specification.

There is one solution available for ruby users https://github.com/civisanalytics/swagger-diff but i am unable to find one that does c#.

shwetap051 commented 7 years ago

I have bandwidth so will help you with this.

RicoSuter commented 7 years ago

Thank you for adding this feature, please create a namespace/directory with the name Comparison in the NJsonSchema project. What do you think?

shwetap051 commented 7 years ago

Just realized this code should go in https://github.com/NSwag/NSwag b/c it already provides methods in core to read a json to C# object SwaggerService so it will be easy to compare the complete json for backward compatibility and noticed you manage NSwag too so is it fine if implement this functionality their?

shwetap051 commented 7 years ago

I will open this issue in NSwag

RicoSuter commented 7 years ago

Actually this must be implemented in NSwag and NJsonSchema.

NJsonSchema.Comparision namespace (NJsonSchema project):

NSwag.Comparison namespace (NSwag.Core project)

RicoSuter commented 7 years ago

I recommend to start with the NJsonSchema functionality and if everything is fine, then implement the Swagger comparison

DotNetRockStar commented 5 years ago

Has there been functionality created to compare two schemas?

jstafford5380 commented 3 years ago

Years later, did this ever get anywhere? I have a similar use case where I need to know if a schema has changed and if it is still backwards compatible.