oapi-codegen icon indicating copy to clipboard operation
oapi-codegen copied to clipboard

Fixed #719: fix generate for union methods.

Open insidieux opened this issue 3 years ago • 10 comments

Fix #719

insidieux avatar Aug 13 '22 11:08 insidieux

Any updates? May be something wrong in PR? It will be cool to merge and release, cause at this moment we're using built binary from fork...

insidieux avatar Aug 24 '22 11:08 insidieux

I'm running into this problem on my private project.

I was looking into submitting a PR and I found this. I tried this changes on my own and confirmed the problem went away. I'm going to use replace_of directive until merge this PR. Thank you.

masu-mi avatar Aug 26 '22 13:08 masu-mi

Hey, sorry we've not gotten around to reviewing just yet - will try to in the coming week.

Mind running make generate and committing the generated files?

jamietanna avatar Aug 28 '22 20:08 jamietanna

Hey, sorry we've not gotten around to reviewing just yet - will try to in the coming week.

Mind running make generate and committing the generated files?

Already done. Nothing new was generated, no changes.

insidieux avatar Aug 30 '22 09:08 insidieux

@jamietanna Hi there! =) Any updates? Can we merge it?

insidieux avatar Sep 05 '22 09:09 insidieux

I'm having trouble picturing this in use - it'd be great to get an example spec added that uses this under the hood, so we have some test data that can then help us avoid breaking changes in the future - would that be possible? 🙏

Example is in linked issue I'll add it here

openapi: "3.0.0"
info:
  version: 1.0.0
  title: Example broken generation with oneOf and external remote ref
paths:
  /check:
    get:
      summary: Return broken example
      responses:
        '200':
          description: Ok
          content:
            application/json:
              schema:
                items:
                  $ref: '#/components/schemas/exampleSchema'
components:
  schemas:
    exampleSchema:
      properties:
        item:
          type: object
          oneOf:
            - $ref: 'https://raw.githubusercontent.com/deepmap/oapi-codegen/master/examples/petstore-expanded/petstore-expanded.yaml#/components/schemas/NewPet'
      required:
        - item

insidieux avatar Sep 07 '22 21:09 insidieux

"Somewhere in the world a kitten is sad at the moment" (с) But, if seriously, is there any updates?

insidieux avatar Sep 14 '22 16:09 insidieux

I never thought when I wrote the original code that we'd be fetching specs over the internet, because that causes a version tracking issue, so we've always cached them locally and updated periodically. As far as oapi-codegen goes, this change looks pretty simple, but your example schema should be included in our tests, to ensure we don't regress on this particular issue in the future.

deepmap-marcinr avatar Sep 14 '22 16:09 deepmap-marcinr

I never thought when I wrote the original code that we'd be fetching specs over the internet, because that causes a version tracking issue, so we've always cached them locally and updated periodically. As far as oapi-codegen goes, this change looks pretty simple, but your example schema should be included in our tests, to ensure we don't regress on this particular issue in the future.

Ok. Thanks for reply. I'll add new tests for this case and 'll return to you)

insidieux avatar Sep 14 '22 16:09 insidieux

@deepmap-marcinr, hi there! I've updated PR: added test-case yaml file and added test for this case.

I'll be grateful if you check this out and merge if everything is ok)

insidieux avatar Sep 19 '22 19:09 insidieux

Guys! Any updates? 2 months delaying PR... =(

insidieux avatar Oct 15 '22 16:10 insidieux

Guys, it's me again =) Let's review and merge? =)

insidieux avatar Oct 22 '22 12:10 insidieux

Done, looks good, thanks.


From: Ageev Pavel @.***> Sent: Saturday, October 22, 2022 5:07 AM To: deepmap/oapi-codegen Cc: Marcin Romaszewicz; Mention Subject: Re: [deepmap/oapi-codegen] Fixed #719: fix generate for union methods. (PR #720)

Guys, it's me again =) Let's review and merge? =)

— Reply to this email directly, view it on GitHubhttps://github.com/deepmap/oapi-codegen/pull/720#issuecomment-1287773741, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ALKC5DGH3OBP4BJ72R6LE4DWEPKHLANCNFSM56N7G7RA. You are receiving this because you were mentioned.Message ID: @.***>

deepmap-marcinr avatar Oct 22 '22 18:10 deepmap-marcinr