Skip to content

Conversation

@paulmach
Copy link
Contributor

@paulmach paulmach commented Jan 9, 2025

This is meant to address #863 which asks for x-go-type to work with $ref. It also fixes my use case which is for x-oapi-codegen-extra-tags like:

obj:
  type: object
  properties:
    start_port:
      $ref: '#/components/schemas/Port'
      x-oapi-codegen-extra-tags:
        bson: start_port
    end_port:
      $ref: '#/components/schemas/Port'
      x-oapi-codegen-extra-tags:
        bson: end_port

I have added tests in the internal/tests/extensions directory to cover a few of the extensions, I can add a complete list if desired.

We already treat x-order in this way (use the value next to the ref if provided) as of #1700 and this pr makes the functionality complete and consistent for all supported extensions.

@paulmach paulmach requested a review from a team as a code owner January 9, 2025 23:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant