Skip to content

Conversation

xuzhg
Copy link
Contributor

@xuzhg xuzhg commented Nov 15, 2017

remove optional properties initializer.

@msftclas
Copy link

@xuzhg,
Thanks for your contribution as a Microsoft full-time employee or intern. You do not need to sign a CLA.
Thanks,
Microsoft Pull Request Bot

@PerthCharern
Copy link
Contributor

What's the rationale behind these changes?

  1. Why does type have to go on top?
  2. Why are we removing the empty Servers, Tags, ExternalDocs?

@xuzhg
Copy link
Contributor Author

xuzhg commented Nov 15, 2017

  1. It seems "type" is always existing in the schema. So, move it to top make the output document has better format.

  2. Servers, Tags, ExternalDocs are optional properties.
    If we initialize them, the output document will have:

{
     "externaldocs": {},
     "tags": {}
}

this pr will avoid writing the empty optional object like this.

@PerthCharern
Copy link
Contributor

For 1), I'm trying to make the properties written out in the same order as their appearance in the spec for clarity. Of course, this is not required, but it is useful for us as a sanity check to see whether all the properties have been taken care of in the WriteAsVX code. This should make maintaining that code easier in the future too. I also don't see the advantage of having "type" at the very top.

  1. Makes sense.

In reply to: 344448632 [](ancestors = 344448632)

@xuzhg
Copy link
Contributor Author

xuzhg commented Nov 15, 2017

Ok for 1.

@xuzhg
Copy link
Contributor Author

xuzhg commented Nov 15, 2017

@PerthCharern So, I revert the "type" change.

Copy link
Contributor

@PerthCharern PerthCharern left a comment

Choose a reason for hiding this comment

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

:shipit:

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.

3 participants