Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If a property has allOf of multiple objects with properties renderer won't render it #476

Closed
mohsen1 opened this issue Jun 2, 2015 · 12 comments

Comments

@mohsen1
Copy link
Contributor

mohsen1 commented Jun 2, 2015

Moved from #272 (comment)

Rendering still doesn't work if it's part of a properties object (shows as empty in view):

swagger: '2.0'
info:
  version: 0.0.3
  title: API
paths:
  /system:
    get:
      summary: some text
      responses:
        '200':
          description: Successful Operation
          schema:
            type: object
            properties:
              id:
                type: string
              type:
                type: string
              attribtues:
                allOf:
                  - type: object
                    $ref: '#/definitions/a'
                  - type: object
                    $ref: '#/definitions/b'
definitions:
  a:
    properties:
      propertyX:
        type: string
  b:
    properties:
      propertyY:
        type: string

But this works ok:

swagger: '2.0'
info:
  version: 0.0.3
  title: API
paths:
  /system:
    get:
      summary: some text
      responses:
        '200':
          description: Successful Operation
          schema:
            type: object
            allOf:
              - type: object
                $ref: '#/definitions/a'
              - type: object
                $ref: '#/definitions/b'
definitions:
  a:
    properties:
      propertyX:
        type: string
  b:
    properties:
      propertyY:
        type: string
@webron
Copy link
Contributor

webron commented Jun 3, 2015

FWIW (and unrelated to the issue directly), adding type: object alongside the $ref is meaningless. It should be part of the a and b definitions though.

@bagofjuice
Copy link

Hi, any idea when this might be implemented/fixed?

@zmeda
Copy link

zmeda commented Aug 12, 2015

+1

@mohsen1 mohsen1 added this to the Backlog milestone Sep 9, 2015
@okthatsneat
Copy link

+1

2 similar comments
@jeff9finger
Copy link

+1

@anneal
Copy link

anneal commented Mar 1, 2016

+1

@jrbasso
Copy link

jrbasso commented Apr 25, 2016

Seems it still not working with latest version using the instragram example:

image

@mimarec
Copy link

mimarec commented Aug 29, 2016

+1

2 similar comments
@jeff9finger
Copy link

+1

@radicale
Copy link

radicale commented Oct 1, 2016

+1

@advance512
Copy link

Also, generation of server/client code in editor.swgger.io doesn't work:

Unable to build target: Could not process model 'HumanProfile'.Please make sure that your schema is correct!

Details:

 Object
code: 1
type:  "error"
message: "Unable to build target: Could not process model 'HumanProfile'.Please make sure that your schema is correct!"

HumanProfile is like in example 2 above, using allOf for 2 object definitions.

@webron
Copy link
Contributor

webron commented Jun 8, 2017

Closing as an old ticket.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests