Skip to content

Conversation

@sergey-shandar
Copy link
Contributor

@sergey-shandar sergey-shandar commented Feb 28, 2019

This PR has several major changes

  1. A new class ParsedJson, which has
  • a typed JSON (JSON which is deserialized into specific type),
  • a JToken (raw deserialized JSON which has line, position information)
  • a file name.
  1. ObjectPath is a sequence of functions which can generate a name of next child property. Because old and new swagger documents may have different paths to the same item (e.g. parameter), we use a function instead of a constant.
  2. ObjectPath functions can resolve '$ref'.

New output

{
  "id": "1039",
  "code": "AddedOperation",
  "message": "The new version is adding an operation that was not found in the old version.",
  "jsonref-old": "old/added_path.json#/paths/~1api~1Operations/post",
  "jsonpath-old": null,
  "location-old": "",
  "jsonref-new": "new/added_path.json#/paths/~1api~1Operations/post",
  "jsonpath-new": "paths./api/Operations.post",
  "location-new": "new\\added_path.json:31:15",
  "type": "Info",
  "docurl": "https://github.com/Azure/openapi-diff/tree/master/docs/rules/1039.md",
  "mode": "Addition"
}

@sergey-shandar sergey-shandar changed the title Sergey/source map Source map Mar 5, 2019
@sergey-shandar sergey-shandar marked this pull request as ready for review March 5, 2019 01:33
@vladbarosan
Copy link

@sergey-shandar can you describe your changes a little please ? that would be of great help for the reviewers

Copy link
Contributor

@veronicagg veronicagg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comments inline. Thanks!

@veronicagg
Copy link
Contributor

Updates look good to me, could you add a test to check on location updates you're making? thanks!

@sergey-shandar
Copy link
Contributor Author

sergey-shandar commented Mar 6, 2019

@veronicagg I will add it as soon as I get confirmation about format of location from @sarangan12.

@sarangan12
Copy link
Contributor

  1. Code changes to add jsonPath to output
  2. Future: Add length of the word with issue

Copy link
Contributor

@sarangan12 sarangan12 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix the ci failure before merge

Copy link
Contributor

@veronicagg veronicagg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thx!

@sergey-shandar sergey-shandar merged commit 958873a into master Mar 7, 2019
@sergey-shandar sergey-shandar deleted the sergey/source-map branch March 7, 2019 21:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants