Generating a client from the document, and when not to

A generated client removes the hand-written HTTP layer and produces a large amount of code nobody has read, in a style nobody chose.

$ openapi-generator generate -i openapi.json -g php -o ./client

$ find client -name '*.php' | wc -l
214

# worth it when:  the API is large, external, and stable
# not worth it when:  you own both sides and use six endpoints

For six endpoints a hand-written client is smaller, more readable and shaped like your domain rather than like the generator’s templates. For a large external API the generated one is the difference between a week and an afternoon. The middle case — an internal API you own — is where the generated client is most tempting and least useful, because the coupling it removes is coupling you control anyway.