Live data from Hacker News

Problems with Swagger

blog.novatec-gmbh.de

161–163 of 163 posts

Re: Problems with Swagger

#161
post #107

Oh, man. There is so much wrong with this article. Here we go: > The documents are written in YAML, which I call XML for lazy people No. That's ridiculous. XML (and JSON, for that matter) is designed to be read and written by machines, not humans. (If the design goal was actually primarily for humans to read and write it, the designers failed. Miserably.) YAML is a nice middle ground, in that it can be unambiguously…

JSON follows JavaScript syntax, which is specifically meant to be written manually, i.e. by humans. (This is one of problems of JSON, by the way: look at commas, for example, especially at the infamous problem of trailing commas being illegal. This is definitely not meant to be written by machines.) XML is indeed for machines, that is, the markup part of it. YAML may be more readable, but note that the specification…

Any non-trivial format that's meant for humans MUST at the least allow comments and should not force humans to write needless characters that would be trivial for a machine to do without (e.g. quotes around key names). Also, I'm flipping the bird to any format or language that doesn't allow me, a human, to use multi-line strings. And in JSON I can't even at least concatenate a few of them into a longer string. JSON is definitely not meant to be written by humans.

Re: Problems with Swagger

#162
post #10

I really like the idea of HATEOAS but I have never seen hypermedia controls done in the wild across any companies I've worked for nor on any client projects. I think it's very cool but a lot of development patterns don't consider it.

HATEOAS if your API needs to maintain state AND you want links AND you want a standard. A game API would be a good use case.

REST if your API should not maintain state between requests. If you want links as a part of your response (and want to use a standard) use e.g. HAL or JSON API.

I view them as mutually exclusive.

Re: Problems with Swagger

#163

One problem... it takes Swagger thirty-freakin-seconds to load its auto-generated whatever for Magento Community, and it has to do this every freakin time!

That's... odd. Even running M2 off of DevBox on my Mac the swagger endpoint renders in 5-10s (first visit).
Post reply on HN