-
Notifications
You must be signed in to change notification settings - Fork 351
ApiDescription.ResponseDescription is not initialized #63
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
Comments
Thank you for your feature request. To help us prioritize this feature correctly, could you please provide as much information as possible about the scenarios and their importance? |
In our project we are creating the |
@Tasteful where are you attempting to change the |
In our case we are implementing an own IApiExplorer that inherits the default ApiExplorer. Whe the ApiDescriptors are returned we find an generic controller, lets call that 'GenericController' that have a route template like '/api/{entityType}'. For each domain entity that can be used with our CRUD operations we will make a copy of the ApiDiscription for the GenericController, replace the entityType-placeholder in the routeTemplate and set the correct ReturnType. This will allow us to have one generic controller for basic CRUD operations but create an Api documentation that contains all the different methods that are typed; instead of a generic method that are untyped and the user need to lookup in some docs site the possibilities of different entity types. In the end we get a nice swagger specification out that are typed. |
🆗 thanks for the information about your scenario. The exact issue is however still not clear to me. Have you encountered a case in which |
If I rcreate a The other properties that not have a public setter is initiated in the ctor
but the The Solutions to make less confusions for developers:
|
I have the |
We couldn't do this for back-compatibility reasons. But, I'm curious: What approach would you use to add |
If |
Also updated the PR to set the property in the ctor instead of making it public. This change will make the implementation binary compatible with the existing one. If changing the property from internal to public it can break any reflection usage. |
Will get #146 into the next milestone. |
When creating an
ApiDescription
from it's own ctor theResponseDescription
is not initiated and the set-property is internal.AspNetWebStack/src/System.Web.Http/Description/ApiDescription.cs
Line 85 in 62d0b2d
Workaround
The text was updated successfully, but these errors were encountered: