Skip to content

Arachnophobia mode #2247

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

Merged
merged 7 commits into from
Oct 21, 2018
Merged

Conversation

Deuchnord
Copy link
Contributor

@Deuchnord Deuchnord commented Oct 9, 2018

Q A
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets none
License WTFPL
Doc PR api-platform/docs#612

One of the greatest bugs in the Human software is their fear of spiders. In some cases, the simple seeing of something big go down the screen makes them feel bad for some seconds, before realizing it's just Webby.

Problem is, the Human software is closed-source, so this PR tries to manage that issue by providing a way to disable displaying Webby on the Swagger UI pages. Of course, Webby remains visible by default.

To disable Webby's display, just add this to API Platform's config:

# /config/api_platform.yaml
api_platform:
    show_webby: false # defaults to true

@@ -54,14 +55,15 @@
/**
* @throws InvalidArgumentException
*/
public function __construct(ResourceNameCollectionFactoryInterface $resourceNameCollectionFactory, ResourceMetadataFactoryInterface $resourceMetadataFactory, NormalizerInterface $normalizer, \Twig_Environment $twig, UrlGeneratorInterface $urlGenerator, string $title = '', string $description = '', string $version = '', /* FormatsProviderInterface */ $formatsProvider = [], $oauthEnabled = false, $oauthClientId = '', $oauthClientSecret = '', $oauthType = '', $oauthFlow = '', $oauthTokenUrl = '', $oauthAuthorizationUrl = '', $oauthScopes = [])
public function __construct(ResourceNameCollectionFactoryInterface $resourceNameCollectionFactory, ResourceMetadataFactoryInterface $resourceMetadataFactory, NormalizerInterface $normalizer, \Twig_Environment $twig, UrlGeneratorInterface $urlGenerator, string $title = '', string $description = '', string $version = '', bool $showWebby = true, /* FormatsProviderInterface */ $formatsProvider = [], $oauthEnabled = false, $oauthClientId = '', $oauthClientSecret = '', $oauthType = '', $oauthFlow = '', $oauthTokenUrl = '', $oauthAuthorizationUrl = '', $oauthScopes = [])
Copy link
Member

Choose a reason for hiding this comment

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

It's a BC. Please add the new parameter at the end instead.

@alanpoulain
Copy link
Member

😢

@alanpoulain
Copy link
Member

Can't we merge this one?

@dunglas dunglas merged commit c901294 into api-platform:master Oct 21, 2018
@dunglas
Copy link
Member

dunglas commented Oct 21, 2018

Thanks @Deuchnord! First PR, but not the last!

@jeremyFreeAgent
Copy link

Thank you very much!!! <3

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.

4 participants