event-catalog / eventcatalog

An open source documentation tool to bring discoverability to your event-driven architectures
https://eventcatalog.dev
MIT License
1.54k stars 131 forks source link

Normalise JSON Schema formatting before diffing in changelog #382

Open estahn opened 1 year ago

estahn commented 1 year ago

Have you read the Contributing Guidelines on issues?

Description

Schema's sometimes may have different formatting. Before passing the schema to the "differ" they should be normalised/formatted to achieve the best result. This is probably up for discussion, whether this is being done automatically by eventcatalog or via CLI when adding the schema.

Motivation

Simplify workflow.

Example

Current Expected
image image
boyney123 commented 1 year ago

Hey @estahn

Interesting, do you have a screenshot of what is happening, and what you expect to happen, to help anyone who wants to pick this up.

estahn commented 1 year ago

@boyney123 I have added screenshots. I would assume running the schema through JSON.stringify({ a:1, b:2, c:3 }, null, 4) before diffing it would solve the issue.