Commit Graph

29 Commits

Author SHA1 Message Date
Pranav K 8d66f104f7 Make types in Microsoft.AspNetCore.Mvc.Internal namespace internal 2018-11-08 14:00:16 -08:00
Pranav K 0989231ed5 Make structs readonly 2018-08-02 15:44:09 -07:00
Pranav K e2b6f07778 Respect LowercaseUrls in ApiExplorer
Fixes #8006
2018-08-02 14:58:41 -07:00
Pranav K 6911e192e4
Add IsRequired and DefaultValue to ApiParameterDescription 2018-06-22 06:51:58 -07:00
Pranav K 6c2ef122f8 Add support for conventions in DefaultApiDescriptionProvider 2018-06-11 16:07:09 -07:00
Pranav K c515cece8e Use ModelMetadataProvider to infer BindingSource on application model 2018-04-02 09:48:49 -07:00
Doug Bunting fc3a815e57
Restore `ModelMetadata.PropertyName != null` behaviour
- #7413 part 2 of 2
- add `ModelMetadata.Name` and `ParameterName`
  - use `Name` instead of `PropertyName` in most cases
- update `ModelMetadata.ContainerType` and other property use
  - choose using `MetadataKind` almost everywhere; support all possibilties
    - usually parameter metadata was possible but not handled
    - worst case was one or two potential NREs, especially `ContainerType.*` dereferences
  - improve `MvcCoreLoggerExtensions` metadata handling
    - add three new debug messages, one for type metadata and two for parameter metadata
- update `ModelMetadata.ContainerMetadata`, `ContainerType` and `PropertyName` doc comments
- no changes needed in Microsoft.AspNetCore.Mvc.ViewFeatures because parameters aren't viewed

nits:
- add missing `TestModelMetadataProvider.ForParameter(...)` method
- remove unused `EmptyModelMetadataProvider` instances in `ModelMetadataTest`
- refactor `ModelValidationResultComparer` out of DataAnnotationsModelValidatorTest`
- take VS suggestions, mostly related to variable inlining and object initializers
2018-03-29 07:22:00 -07:00
Ryan Nowak c93c168df3 Add mapping service for action results
This allows the use of custom 'envelope' types like ActionResult<> with
a corresponding API Explorer implementation.

Basically this PR services to decouple a bunch of infrastructure from
ActionResult<>.
2018-03-27 17:13:41 -07:00
Doug Bunting 5e245da326
Add compatibility switch controlling parameter metadata and top-level validation
- #7413 part 1 of 2
- made all `ModelMetadataProvider` and `ObjectModelValidator`-specific code conditional
  - fortunately, `MvcOptions` easy to get; affected code is primarily `internal` or pub-`Internal`
  - remove unnecessary `ModelMetadataProvider` use in `ApiBehaviorApplicationModelProvider`
- run integration and functional tests with `CompatibilityVersion.Version_2_1`
  - functional test change depends on @javiercn's recent #7541 fix
  - remove test code now redundantly turning compatibility switches on

nits:
- correct spelling errors in `CompatibilitySwitch`
- take VS suggestions, mostly in test code
- rename methods in `ControllerBinderDelegateProviderTest` to match current API
- slightly refactor in `ApiBehaviorApplicationModelProvider`
2018-03-26 12:29:04 -07:00
Kiran Challa 09b5ff7b72 Use ParameterInfo for getting metadata of a parameter to show the correct information in ApiExplorer
[Fixes #7435] 2.1-Preview 1: IsBindingRequired and IsRequired still false with RequiredAttribute on controller parameter.
2018-03-19 11:50:19 -07:00
Pranav K ab4c519dd5 Infer multipart/form-data for FromFile parameters 2017-11-02 09:36:31 -07:00
Pranav K 63397653fa Make DefaultApiDescriptionProvider understand ActionResult<T>
Fixes #6784
2017-09-11 14:20:38 -07:00
bchavez 16c267d95e House Cleaning - Spelling and grammar 🚿 2017-08-30 14:58:44 -07:00
Pranav K c27b07ef3f Use C# 7 features 2017-06-11 22:11:51 -07:00
Pranav K 1c4b0fcdf3 Code clean up 2017-06-09 22:38:46 -07:00
Pranav K 1c5e417606 Change TFM to netcoreapp2.0 (#6234)
* Change TFM to netcoreapp2.0
2017-05-04 18:11:26 -07:00
Pranav K 8fa95d66d4 Add support for suppressing inbound and outbound routing 2017-04-14 17:02:45 -07:00
Jass Bagga 07c22f2b29 Mutate API description parameter type from JsonPatchDocument to Operation[]
Addresses #5464
2017-01-13 16:39:08 -08:00
Doug Bunting 7178464ed2 Munch on less memory when handling property metadata
- #5499
- switch `foreach` to `for` and use less Linq when accessing `modelMetadata.Properties`
- change backing field for `ModelExplorer.Properties` from a list to an array
2016-12-05 20:47:45 -08:00
jbagga 41f00eea23 Default Status Code for void types changed to 200
Fixes #4838
2016-10-06 14:39:04 -07:00
Kiran Challa f1982bd987 Suppress default status code response type in api descriptions when explicit response types have been provided
[Fixes #4823] How to override the default (200) status code with ProducesResponseType
2016-06-09 12:07:52 -07:00
Pranav K bb226aef6b Update Mvc.Core and dependencies to netstandard1.6 2016-05-26 16:52:04 -07:00
Kiran Challa 6e9a6a2db1 Added new attribute ProducesResponseTypeAttribute to enable ApiExplorer to expose response type and StatusCode.
[Fixes #4101] StatusCode Metadata
2016-03-30 11:51:58 -07:00
Pranav K 06289945d0 Reacting to CoreCLR package changes 2016-03-22 14:49:43 -07:00
Pranav K e9b766fe80 Updated missed ifdefs in netstandard conversion 2016-03-01 16:03:05 -08:00
Doug Bunting f889965929 Simplify `IsAssignableFrom()` use
- standardize on the `Type` extension method; less verbiage
- `ModelMetadata` had a redundant `IsAssignableFrom()` call
- `ModelBindingHelper.ValidateBindingContext()` over-engineered and used just once
 - do useful bit inline in `KeyValuePairModelBinder` but now a silent "does not apply" case
2016-02-26 21:30:00 -08:00
Ajay Bhargav Baaskaran 028c0fb131 Enabled xml doc generation 2016-02-24 12:19:46 -08:00
N. Taylor Mullen 3be7fbdf9f Rename AspNet 5 file contents.
See https://github.com/aspnet/Announcements/issues/144 for more information.
2016-01-22 12:18:33 -08:00
N. Taylor Mullen 6a6c8ca544 Rename AspNet 5 folders and files.
See https://github.com/aspnet/Announcements/issues/144 for more information.
2016-01-22 12:17:07 -08:00