Commit Graph

3042 Commits

Author SHA1 Message Date
Doug Bunting 95b4dc8ca0
Add first cut of Microsoft.Extensions.ApiDescription.Client package / project
- WIP in a number of ways
2018-10-10 14:52:36 -07:00
James Newton-King 9daf5ff7a4
Fix PageRouteTransformerConvention with custom page routes (#8576) 2018-10-10 18:33:30 +13:00
David J. Quiroga 956441aa68 Ignore created URI if Assembly.CodeBase contains a fragment (#8556)
* Fixes #8367
2018-10-08 10:41:04 -07:00
Ryan Nowak 67a1f2dda9 Add security text about Host header 2018-10-05 22:26:37 -07:00
Ryan Nowak 384b814349 React to IEndpointSelectorPolicy changes 2018-10-05 21:03:53 -07:00
Doug Bunting 5bddd226a3
Use Internal.AspNetCore.Sdk as an MSBuild SDK
- should resolve issues with occasional strange MSBuild caching issues in this repo
- modeled after aspnet/Scaffolding#905
- follows aspnet/BuildTools#729 recommendation to check in global.config file
  - see also Microsoft/msbuild#2914
- use newer KoreBuild
  - `.\build.cmd -update /t:noop`
2018-10-04 15:12:38 -07:00
Pranav K 153165f9ad
Handle OPTIONS requests without a handler in Razor Pages (#8528)
* Handle OPTIONS requests without a handler in Razor Pages

Fixes #7438
2018-10-04 12:25:36 -07:00
James Newton-King 94101a9cde
Add PageRouteTransformerConvention (#8541) 2018-10-04 17:34:26 +13:00
James Newton-King 7854d65c11
Support page parameter in attribute route (#8530) 2018-10-04 14:39:40 +13:00
Alexej Timonin 70ddf15cbc MethodMatches 🚿 2018-10-02 12:57:18 -07:00
Pranav K a48e75dfb4
Implicitly set content type for ObjectResults containing ProblemDetails (#8512)
* Implicitly set content type for ObjectResults containing ProblemDetails

Fixes #8467
2018-10-02 10:24:38 -07:00
Ryan Nowak 3667b0481a React to routing API changes
Reaction for: https://github.com/aspnet/Routing/pull/822
2018-09-30 14:26:06 -07:00
Ryan Nowak cb1393cbb1 Adding functional tests for LinkGenerator 2018-09-29 20:34:48 -07:00
Nate McMaster ef21286792
Fix microbuild code signing configuration (#8511)
Fixup the paths to files to be signed.
2018-09-28 10:36:56 -07:00
Pranav K ccb6579cd7
Do not return ProblemDetails for < 4xx status codes
Fixes #8504
2018-09-28 10:33:45 -07:00
Pranav K 8311fd870b
Include the response type in ProducesResponseType for client errors (#8490)
* Include the response type in ProducesResponseType for client errors

* Refactor ActualApiResponseMetadata discovery in to a separate more manageable type
* Annotate action result ctors and helper methods that specify the "object" value with attribute
* Modify the discovery of parameters to match ActionResultObjectValueAttribute and ActionResultStatusCodeAttribute by name
  to allow users to write and annotate custom helper methods and action results, a la NotNullAttribute.

Fixes #8345
2018-09-26 15:51:49 -07:00
Ryan Nowak 831937c86c Add LinkGenerator extensions for MVC 2018-09-26 09:37:46 -07:00
Pranav K 50cef4822a
Invoke FlushAsync before disposing the HttpResponseWriter in JsonResultExecutor
Fixes #8486
2018-09-24 13:00:56 -07:00
Ryan Nowak 89a962716f React to Routing LinkGenerator changes 2018-09-22 15:47:38 -07:00
Doug Bunting 5c8dfef15e
Change `CollectionModelBinder` and `ComplexTypeModelBinder` to enforce `[BindRequired]`
- #8180
- add an error when binding fails for top-level model
  - same case as when MVC creates "default" / empty model i.e. `ParameterBinder` can't detect this
- update `CollectionModelBinder` subclasses and the various providers as well
- controlled by existing `MvcOptions.AllowValidatingTopLevelNodes` option

smaller issue:
- change `ModelBinding_MissingBindRequiredMember` resource to mention parameters too
2018-09-21 11:08:16 -07:00
Ryan Nowak 5c4c746797 Reaction PR from routing rename 2018-09-20 10:15:50 -07:00
Pranav K 9c424b7b02
Use content-type specified by ProducesAttribute if no formatter supports it
This allows users to use `ProducesAttribute` to specify the content-type
for action results such as FileStreamResult where the result determines the content type
and the specified value is informational.

Fixes https://github.com/aspnet/Mvc/issues/5701
2018-09-19 13:51:31 -07:00
Pranav K f7da3503d6 Allow Implicit 200 status codes to match Ok result 2018-09-19 12:51:13 -07:00
Doug Bunting 47d6d4e82c
Update `FormFileModelBinder` to re-add prefix `ParameterBinder` removed incorrectly
- #7562 part 2
- add `OriginalModelName` to `ModelBindingContext`

nit: take VS suggestions, mostly to inline collection initialization in `FormFileModelBinderTest`
2018-09-18 11:44:48 -07:00
Doug Bunting c13e2498a8
Create model in `ComplexTypeModelBinder` if ANY property has a greedy binding source
- #7562 part 1
2018-09-18 11:44:37 -07:00
Pranav K 4b83f7b510
Make FileVersionProvider repleacable
Fixes #6371
2018-09-14 09:14:02 -07:00
Pranav K 233140c33a
Allow IFormFile parameters annotated with [FromForm] to be correctly … (#8452)
* Allow IFormFile parameters annotated with [FromForm] to be correctly bound in ApiControllers

Fixes #8311
2018-09-14 09:06:32 -07:00
Ryan Nowak 35597db277 Fix #8451
Change tokens can call into your code IMMEDIATELY when you subscribe. I
reviewed our other usage of ChangeToken.OnChange in MVC and everything
looks good.
2018-09-13 15:38:42 -07:00
Pranav K cb88e906b2 Allow ProducesAttribute to apply along with conventions
Fixes #8389
2018-09-12 13:58:02 -07:00
Pranav K a73d073eea
Allow ApiControlelrAttribute to be applied to assemblies
Fixes #7343
2018-09-12 13:42:22 -07:00
Pranav K 13281613a5
Refactor DefaultPageApplicationModel to use conventions 2018-09-12 12:28:16 -07:00
Simon Cropp 43d4416a1d Fix typos (#8413) 2018-09-12 09:34:45 -07:00
James Newton-King dfae9c208a
Add IParameterTransformer support (#8329) 2018-09-12 21:46:41 +12:00
James Newton-King 105f8b47a1
Fix endpoint support for area/controller/action in attribute route (#8447) 2018-09-12 21:16:50 +12:00
James Newton-King 6e27a04bf3
No HttpContext to route constraints in MvcEndpointDataSource (#8436) 2018-09-11 10:12:09 +12:00
Ryan Nowak f573b8840a Fix aspnet/Routing#782
Currently MVC is still running the IActionConstraint implementations for
features that we've already moved into the routing layer. This has a
significant perf cost associated with, and so we want to skip it because
it's redundant. However if anyone has implemented their own
`IActionConstraint`-based features, they still need to just work.

This change takes the approach of skipping the action constraint phase
at runtime unless we see something 'unknown'. This is an all or nothing
choice, and will run action constraints if **any** action constraint we
don't special case exists. This is the most compatible behavior (running
redundant constraints) when the application is using constraints that
the developer implemented.

Another approach I considered was to eliminate these constraints as part
of the process of building ADs. I don't think that's ideal because
people have written code that introspects action constraints. We should
consider something like this in 3.0.
2018-09-09 15:17:05 -07:00
Pranav K 013697ad89
Remove experimental analyzers 2018-09-07 16:03:06 -07:00
Joni 72f7e52e1e Remove blank line 2018-09-07 14:48:17 -07:00
gqqnbig fd80509fef LocalizedHtmlString.Value doesn't include arguments (#8376)
* Clarify that Value is prior to formatting with any constructor arguments
2018-09-07 08:58:52 -07:00
Casey O'Brien 74ba9898f4 [Fixes #8250] Improve the error message when TEntryPoint is not in an entry point assembly
Validates that the type used as a generic argument in WebApplicaitonFactory is contained within the entry point to assembly and throws InvalidOperationException otherwise
2018-09-06 18:02:21 -07:00
James Newton-King 863b1c2c97
Action endpoint metadata contains attributes from action and controller (#8395) 2018-09-07 10:01:40 +12:00
Pranav K 07cc9e66c6
Add a feature to disable file watching in Razor pages (#8369)
* Add a feature to disable file watching in Razor pages

Fixes https://github.com/aspnet/Mvc/issues/8362
2018-09-06 10:16:31 -07:00
Simon Cropp b156dee4f1 Fix some spelling (#8378) 2018-09-06 07:39:01 -07:00
Takaaki Suzuki c0f3a46ffe
Don't call GetValidity method twice. 2018-09-06 07:33:48 -07:00
Ben Adams e174d277bd Inline 2018-09-05 20:53:06 -07:00
Ben Adams 337bc462de Fast-path async in PagedBufferedTextWriter 2018-09-05 20:53:06 -07:00
Ryan Nowak fabe189470 React to LinkGenerator changes 2018-09-05 20:52:37 -07:00
Hassan Hashemi bca3160190 Remove redundant check
fixed https://github.com/aspnet/Mvc/issues/8374
2018-09-05 17:04:20 -07:00
Pranav K d8b7dbd1f3
Avoid null refs when IStatusCodeActionResult cannot be discovered 2018-08-30 15:17:09 -07:00
Ben Adams 3dfa26f7e3 Resolve virtual ViewContext max once per method 2018-08-30 14:04:08 -07:00