cyclosproject / ng-openapi-gen

An OpenAPI 3.0 codegen for Angular
MIT License
397 stars 132 forks source link

Self-referencing object (array) example failing test #91

Closed tommck closed 4 years ago

tommck commented 4 years ago

Hope to dig through and figure out the problem shortly.

I'll also update without the focused describe too

tommck commented 4 years ago

This is related to #90

Also, looks like we need more "hack" code in model.ts or the Property needs to be more aware of what object it's on :(

luisfpg commented 4 years ago

Well, taking into account that it may be deep, we should give Property more context. For example:

namespace.Type:
  propertyA:
    allOf:
      - $ref: '#/components/schemas/SuperType'
      - type: object
        properties:
          deepReference:
            $ref: '#/components/schemas/namespace.Type'
tommck commented 4 years ago

oh right!.. huh.. that sounds complicated.. I'll try to take a look at it, but if you have time to do it, that would be greatly appreciated

luisfpg commented 4 years ago

I'll see if I can find a solution

tommck commented 4 years ago

I just pushed something that might fix it

tommck commented 4 years ago

I have no idea how to test the deep property reference stuff simply

tommck commented 4 years ago

@luisfpg let me know what you think about what I pushed. Not sure if I'm missing something, since I'm new to this code / openapi stuff

luisfpg commented 4 years ago

@tommck I have performed a few changes:

It is merged to master. Please, test it by linking locally (see https://github.com/cyclosproject/ng-openapi-gen#developing-and-contributing). If it is OK, I'll make a new version (will actually be 0.10.0, because of #89).

tommck commented 4 years ago

tests passed locally.. going to try it with my actual code base in just a minute

tommck commented 4 years ago

Looks like it's working locally! 🥳

tommck commented 4 years ago

Thanks so much for being so responsive on this @luisfpg. You rock!

luisfpg commented 4 years ago

Great. I'll see if I can make the new version later today. Otherwise, will publish tomorrow.

tommck commented 4 years ago

:D image