Skip to content
This repository has been archived by the owner on Oct 17, 2020. It is now read-only.

How to generate array with referenceByClass? #4

Closed
dianxin11 opened this issue Sep 30, 2017 · 2 comments
Closed

How to generate array with referenceByClass? #4

dianxin11 opened this issue Sep 30, 2017 · 2 comments

Comments

@dianxin11
Copy link

Hi,
I'm a newbie on swagger, I want to generate the json code like this:

            "responses": {
                "200": {
                    "description": "successful operation",
                    "schema": {
                        "type": "array",
                        "items": {
                            "$ref": "#/definitions/Pet"
                        }
                    }
                },
            },

I try to this 'data' => Kobe::referenceByClass(Pet::class)->toArray() but isn't work.
What should I do?
Thanks!

@AaronJan
Copy link
Owner

Hi, dianxin11, you can try this:

Kobe::makeArray()->setReferenceAsItems(Kobe::referenceByClass(Pet::class))

Let me know if you solve this.

@dianxin11
Copy link
Author

Thanks a lot, it worked!

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

No branches or pull requests

2 participants