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

"Prevent merging" conflicts with Schema validation #229

Closed
dakujem opened this issue Jan 13, 2020 · 6 comments
Closed

"Prevent merging" conflicts with Schema validation #229

dakujem opened this issue Jan 13, 2020 · 6 comments

Comments

@dakujem
Copy link

dakujem commented Jan 13, 2020

Version:

  • nette/di: master|3.0.2
  • nette/schema: 1.0.2
  • nette/application: 3.0.3

The exception

Nette\DI\InvalidConfigurationException
The option 'application › mapping › _prevent_merging' expects to be string or array, bool given.

image

I believe the Schema is trying to validate _prevent_merging => true as one of the mapping options, which should not be the case.

The configuration

application:
    errorPresenter: Error
    mapping!:
        *: App\*Module\Presenters\*Presenter
@dakujem dakujem changed the title "Prevent merging" conflicts with Schema "Prevent merging" conflicts with Schema validation Jan 13, 2020
@Gappa
Copy link

Gappa commented Jan 31, 2020

I've encoutered the same problem with scanDirs, which can be currently disabled, added to, but not overwritten:

application:
    scanDirs!:
        - myCustomDir/

Which results to:

Nette\DI\InvalidConfigurationException
The option 'application › scanDirs › _prevent_merging' expects to be string, bool given.

Relevant packages:

nette/application     v3.0.3 
nette/di              v3.0.3
nette/schema          v1.0.2

@Gappa
Copy link

Gappa commented Jan 31, 2020

I just found out that (at least for scanDirs) the behaviour is different from user defined directives - by specifying a value the default one gets overridden:

So this:

application:
    scanDirs:
        - myCustomDir/

actually results to ['myCustomDir/'] and not ['%appDir%', 'myCustomDir/'] as I was expecting and trying to override.

So, is this a bug afterall or just a change in behaviour?

@dg
Copy link
Member

dg commented Jan 31, 2020

@Gappa it seems like a bug

@f3l1x
Copy link
Member

f3l1x commented Dec 1, 2020

I have just hit the same error. Also with application.scanDirs and application.mapping.

I have prepared PR with failing tests (#250)

@dg
Copy link
Member

dg commented Dec 18, 2020

fixed

@f3l1x
Copy link
Member

f3l1x commented Dec 18, 2020

❤️

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

4 participants