interagent / schematic

A Go point of view on JSON Schema
https://godoc.org/github.com/interagent/schematic
MIT License
321 stars 33 forks source link

Disallow duplicate link titles #46

Closed wchrisjohnson closed 7 years ago

wchrisjohnson commented 7 years ago

https://github.com/interagent/schematic/issues/45

Dropping numerous client API calls as a part of client generation is probably an incorrect approach, both here in schematic and in the ruby version of this tool, Heroics.

While a number of PRs have been initiated to fix the underlying heroku platform api schema itself, I believe these two tools should raise an error and should not generate an incomplete client in the event of duplicate link titles.

This PR replaces the code that was dropping the duplicate links with a method that checks for dups and panics if any are found.

During the discussion here (https://github.com/heroku/api/pull/7787#issuecomment-299169974) we are attempting to do the following:

cyberdelia commented 7 years ago

@alindeman Mind having a look too? It seems fine to me.

gudmundur commented 7 years ago

Nice work @wchrisjohnson!

gudmundur commented 7 years ago

Related PR into Heroics: https://github.com/interagent/heroics/pull/91.

alindeman commented 7 years ago

Awesome, glad to see this cleaned up @wchrisjohnson!

wchrisjohnson commented 7 years ago

@alindeman me too! I'm looking forward to getting all those dropped API calls back in the client.

Also, thanks to your efforts it was relatively easy to know how to dig into the code to fix this. Thank you!