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

Import AnnotationsProvider & Parser from NelmioApiDocBundle #410

Merged
merged 1 commit into from Mar 14, 2016

Conversation

teohhanhui
Copy link
Contributor

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets #219
License MIT
Doc PR N/A

Continuation of #225

Includes fix for nelmio/NelmioApiDocBundle#678

@teohhanhui teohhanhui force-pushed the nelmio_import branch 2 times, most recently from 21acc3d to 52b3369 Compare February 18, 2016 15:07
@sroze
Copy link
Contributor

sroze commented Mar 6, 2016

Nice! The problem is that there are conflicts now, could you fix them?
Mind the namespace change too.

@teohhanhui
Copy link
Contributor Author

Rebased to latest master. Lots of refactoring. I hope it's correct.

Help needed for adapting tests from NelmioApiDocBundle.

*
* @author Kévin Dunglas <dunglas@gmail.com>
*/
class ApiPlatformProvider implements AnnotationsProviderInterface
Copy link
Member

Choose a reason for hiding this comment

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

Can you make it final?

@dunglas
Copy link
Member

dunglas commented Mar 8, 2016

I left some minor comments but you made - again - an awesome work.

What kind of help do you needs for importing test? IMO we can adapt:

And use one of the test entity from the TestBundle.

@teohhanhui teohhanhui changed the title Import ApiProvider & Parser from NelmioApiDocBundle Import AnnotationsProvider & Parser from NelmioApiDocBundle Mar 9, 2016
@teohhanhui
Copy link
Contributor Author

All comments addressed, and tests added (I hope they're not too fragile?)

ping @dunglas @sroze

$prefixedShortName = ($iri = $resourceMetadata->getIri()) ? $iri : '#'.$resourceMetadata->getShortName();
$resourceHydraDoc = $this->getResourceHydraDoc($hydraDoc, $prefixedShortName);

if ($hydraDoc) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@dunglas I'm very curious about this condition. It looks wrong to me... This check would have been done before the loop if this was your intention...

I basically did not change any logic from the previous code (only adapting them to changes). This is the same from https://github.com/nelmio/NelmioApiDocBundle/blob/2a0f95eac0ab2aa466545d0b21d15739636811b7/Extractor/AnnotationsProvider/DunglasApiProvider.php#L71

@teohhanhui
Copy link
Contributor Author

@api-platform/core-team

dunglas added a commit that referenced this pull request Mar 14, 2016
Import AnnotationsProvider & Parser from NelmioApiDocBundle
@dunglas dunglas merged commit 339b29b into api-platform:master Mar 14, 2016
@dunglas
Copy link
Member

dunglas commented Mar 14, 2016

Thanks @teohhanhui

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.

None yet

3 participants