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

Add augmentation for operations #293

Closed
wants to merge 2 commits into from
Closed

Add augmentation for operations #293

wants to merge 2 commits into from

Conversation

mjanser
Copy link
Contributor

@mjanser mjanser commented Mar 3, 2016

This will extract the summary and description for operations from the
phpdoc method description.

@@ -13,7 +13,7 @@ class UtilTest extends SwaggerTestCase

public function testExclude()
{
$swagger = \Swagger\scan(__DIR__ . '/Fixtures', ['exclude' => ['Customer.php', 'UsingRefs.php', 'GrandParent.php']]);
$swagger = \Swagger\scan(__DIR__ . '/Fixtures', ['exclude' => ['Customer.php', 'UsingRefs.php', 'UsingPhpDoc', 'GrandParent.php']]);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing a .php? :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hm, true :) it worked anyway but I fixed it now.

This will extract the summary and description for operations from the
phpdoc method description.
@mjanser
Copy link
Contributor Author

mjanser commented Apr 15, 2016

Does anything speak against merging this?

@bfanger
Copy link
Collaborator

bfanger commented Apr 16, 2016

I'd like it if the splitting of the description and summary was moved to the AugmentOperations or Util class, but didn't make the time to do that yet.

@mjanser
Copy link
Contributor Author

mjanser commented Apr 16, 2016

That's a good idea, I moved the splitting of the description to AugmentOperations. What do you think?

@bfanger
Copy link
Collaborator

bfanger commented Apr 17, 2016

Merged as 2eec9f1 i've updated Context->extractDescription() to include linebreaks and updated AugmentOperations accordingly, i've also made the blankline between a summary and a description a requirement.

Let me know if you disagree with the changes i've made. and thanks the pull request!

@mjanser
Copy link
Contributor Author

mjanser commented Apr 17, 2016

Thanks for merging!

The only thing I'm unsure about your changes is if the handling of line breaks is correct now. According to phpdoc the description is kind of markdown and therefore only blank lines create new paragraphs.

@bfanger
Copy link
Collaborator

bfanger commented Apr 17, 2016

Interresting read, even specifies the rules for the destinction between summary and description. and it's github flavored markdown which converts single line breaks to <br> and blank lines as <p> so preserving the line breaks should be fine.

I'm not sure what to do for the @SWG\Property situation as a schema doesn't have summary/description. but does have a title/description.

@bfanger bfanger force-pushed the master branch 2 times, most recently from 21a9615 to a51f62c Compare April 17, 2016 14:09
@bfanger
Copy link
Collaborator

bfanger commented Apr 17, 2016

Moved summary / description logic back to the Context as it applies to all phpdoc comments not just the AugmentOperation. Also implemented the splitting by the "line ending with a . " specification.

@mjanser
Copy link
Contributor Author

mjanser commented Apr 17, 2016

Cool, looks good. I'll close this pull request then.

@mjanser mjanser closed this Apr 17, 2016
bfanger added a commit that referenced this pull request May 27, 2016
 - Beter validation of type="file" #305
 - Augment Operations summary and description based on the comment. #293
 - Bugfixes #300
 - Add support for xml (and externalDocs and properties) inside a @swg\Items. #279
 - Nested properties are no longer injected into the Definition #297
 - Fixed nesting issue with verbose property notation #297
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

Successfully merging this pull request may close these issues.

3 participants