Repository navigation
How to best use tracey with OpenAPI generation or generated code in general? #145
Unanswered
astromechza
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
I frequently use OpenAPI to define an API spec and then use a build-time code generator which covers both the routing and parameters / body decoding. However, these code generators vary in quality and correctness between languages and frameworks.
Naturally this covers a large chunk of behaviour in an associated tracey spec. So the question is, how do I best integrate these? I've considered:
A single "implements the spec" requirement and assume the code generator is correct. Seems like a dangerous assumption and means the coverage and byte code association is too coarse grained.
Automatically generate a set of spec requirements from the OpenAPI operations, and add explicit tests for them. The impl code still isn't referenced correctly, but at least the test coverage is more correct.
See Tracey as the source of truth, and add the impl annotations to the OpenAPI spec. Somehow copy these over to the generated code or allow Tracey to use yaml as an implementation language (sounds horrible)
Thoughts?
All reactions