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

@Attributes is not parsed into the bluprint doc #18

Open
lightvision opened this issue Nov 28, 2015 · 3 comments
Open

@Attributes is not parsed into the bluprint doc #18

lightvision opened this issue Nov 28, 2015 · 3 comments

Comments

@lightvision
Copy link

@jasonlewis The "@Attributes" is not parsed into the blueprint documentation upon generation.

I've used the example from the blueprint/tests/Stubs/UserPhotosResourceStub.php

Anyway to solve it? Thanks

@jasonlewis
Copy link
Contributor

What are you seeing exactly? I'll hopefully be able to dedicate some good time to Dingo over the next few days.

@tdanielcox
Copy link

Hey Jason,
I am also seeing the same thing. I have tried both ways that are shown in the tests:

https://github.com/dingo/blueprint/blob/master/tests/Stubs/UsersResourceStub.php#L55

/**
* Post a channel
*
* Add a new channel
*
* @Post("/")
* @Transaction({
*     @Request(body={
*         "title": "Lorem ipsum dolor...",
*         "description": "Lorem ipsum dolor..."
*     }, attributes={
*         @Attribute("title", type="string", required=true, description="The title of the channel", sample="Lorem ipsum dolor..."),
*         @Attribute("description", type="string", required=false, description="The long description of the channel (max 1000, HTML yes)", sample="Lorem ipsum dolor...")
*     }),
*     @Response(201),
*     @Response(400),
*     @Response(401)
* })
*/

https://github.com/dingo/blueprint/blob/master/tests/Stubs/UserPhotosResourceStub.php#L73

/**
* Post a channel
*
* Add a new channel
*
* @Post("/")
* @Attributes({
*      @Attribute("title", type="string", description="The title of the channel", sample="Lorem ipsum dolor..."),
*      @Attribute("description", type="string", description="The description of the channel", sample="Lorem ipsum dolor...")
* })
* @Transaction({
*     @Response(201),
*     @Response(400),
*     @Response(401)
* })
*/

I am not seeing the Attributes being generated using either method. Also, there is not documentation for Attribute (at least that I have seen)

I get this error when adding attributes to the @request object:

The annotation @request declared on method [...] does not have a property named "attributes". Available properties: body, contentType, identifier, headers

No errors are thrown when adding attributes to the @Attributes object, however no attributes are generated.

Hope this helps.

@lightvision
Copy link
Author

@jasonlewis The problem is that even the dingo/api is updated to the latest version is not getting the latest version of dingo/blueprint available on github. I had to clone dingo/blueprint inside my vendor folder to override the dingo/blueprint package in order to make that annotations to work.

Off-topic: It should be nice to have the output file for generated documentation available in config too. I think I will send a PR, there is not much work involved.

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

3 participants