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

Enable to specify model properties anywhere #54

Closed
nbehier opened this issue Dec 18, 2012 · 1 comment
Closed

Enable to specify model properties anywhere #54

nbehier opened this issue Dec 18, 2012 · 1 comment

Comments

@nbehier
Copy link
Contributor

nbehier commented Dec 18, 2012

I would like to describe a model outside its class defined file (Example : dynamic class response).
It means, I should be able to list model properties like following

/**
 * @Model(
 *   id="PetResponse,
 *   @Properties(
 *     @Property(name="status",type="int"),
 *     @Property(name="statusLabel",type="string"),
 *     @Property(name="tags",type="array", items="$ref:Tag")
 *   )
 * )
 */

I create a new Swagger\Annotations\Properties file like Swagger\Annotations\Parameters.
But I do not know how to implement the discoverClassAnnotations() part to keep the normal Property work in parallels of @Properties(Property).

I look for implement it, but I would like to have your feeling about it. Would you have some advices?

@zircote
Copy link
Owner

zircote commented Dec 19, 2012

I like this idea, I will look into this week as I have time.

Thank you.

nbehier pushed a commit to nbehier/swagger-php that referenced this issue Dec 19, 2012
- Add @properties to @model
- Modify fixtures file
- Tested
zircote added a commit that referenced this issue Mar 25, 2013
Resolves #54
Resolves #55

Conflicts:
	library/Swagger/Swagger.php
	tests/Swagger/Fixtures/Resources/Pet.php
zircote added a commit that referenced this issue Mar 25, 2013
Resolves #54
Resolves #55

Conflicts:
	library/Swagger/Swagger.php
	tests/Swagger/Fixtures/Resources/Pet.php
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

No branches or pull requests

2 participants