Reconcile matching schemas in root document to avoid anonymous structs
For https://github.com/deepmap/oapi-codegen/issues/1362
OpenAPI specifications can be spread across different files for maintainability. However this is not great for code-gen which can't recognise when two schema refs refer to the same model. This results in the code-gen using duplicating anonymous structs (which can't easily be used).
I have added a patch to kin upstream (https://github.com/getkin/kin-openapi/pull/945) which identifies when a ref refers to a schema from the root #/components/schemas and makes use of the go model generated from that.
See https://github.com/oapi-codegen/oapi-codegen/pull/1573/commits/f71a97a6c8d289616263a2a864ddf1da51ffbd0d which shows the change codegen changes:
Note: Also adds test spec to test for regression against #1572
The changes needed to the kin-openapi library are present in v0.126.0, I'll wait for https://github.com/oapi-codegen/oapi-codegen/pull/1689 to be merged before completing this PR
This is now ready for review