Comments (33)
I am getting this error with:
Swashbuckle.Core" version="5.4.0"
Swashbuckle.OData" version="2.18.3"
from swashbuckle.odata.
I'm having the same problem with the following versions:
Swashbuckle.Core" version="5.4.0"
Swashbuckle.OData" version="2.18.4"
from swashbuckle.odata.
@danroot Do you know what the resolution is? If so, can you submit a pull request or just explain clearly how to reproduce and I can fix today.
from swashbuckle.odata.
Ok, found it, Swashbuckle.OData 2.16.0 is not compatible with Swashbuckle.Core 5.3.1, you need Swashbuckle.Core 5.2.2 instead. The reason is that the SchemaRegistry class editor changed the sequence of arguments.
from swashbuckle.odata.
Hi Jürg, thanks for posting this issue. I'll try to make the latest Swashbuckle.OData compatible with the latest Swashbuckle.Core. I hate having to use reflection for just this reason. Wasn't a reflection issue. Looks like Swashbuckle.Core actually made a backwards-incompatible change on a public class/constructor.
from swashbuckle.odata.
Opened domaindrivendev/Swashbuckle.WebApi#650 to see if the author can revert to the previous parameter order. For now I will update Swashbuckle.OData to a strict dependency on Swashbuckle.Core v5.2.2.
from swashbuckle.odata.
v2.16.2 now specifies a hard dependency on Swashbuckle.Core v5.0.0-5.2.2.
from swashbuckle.odata.
Created pull request in Swashbuckle to fix this issue. domaindrivendev/Swashbuckle.WebApi#652
from swashbuckle.odata.
Same problem as for @ac4simms
from swashbuckle.odata.
Hi I am also having the same problem as @ac4simms, with the same versions.
from swashbuckle.odata.
Same here, tried to update and it broke.
from swashbuckle.odata.
I'll check it out. thanks.
from swashbuckle.odata.
Seeing this too and wind up in package hell when trying to resolve. Swashbuckle.Core 5.3.2 doesn't support EnableApiKeySupport, so I need 5.4.0.
from swashbuckle.odata.
I'm not to where I can do a pr just yet, but will try to get the code and do that in the future. In the meantime, I suspect the issue is same as before - ODataSwaggerProvider.GetSwagger's call to the SchemaRegistry constructor fails because Swashbuckle.Core changed the constructor parameters.
Steps to repro:
- VS -> New -> ASP.NET -> Check Web API
- Install-Package Swashbuckle.OData
- Install-Package Swashbuckle.Core (this will update to 5.4.0)
- Add minimal Swashbuckle config to WebApiConfig:
config
.EnableSwagger(c =>
{
c.SingleApiVersion("v1", "https://api.company.com");
c.ApiKey("Token")
.Description("Filling bearer token here")
.Name("Authorization")
.In("header");
c.CustomProvider(defaultProvider => new ODataSwaggerProvider(defaultProvider, c));
})
.EnableSwaggerUi(c =>
{
c.EnableApiKeySupport("Authorization", "header");
//TODO: Note for Bearer token to work, you'd need to inject some custom js here, omitted for these repro steps
});
- Ctrl-F5, browse to /swagger/ui/index
- Observe exception:
ExceptionMessage":"Method not found: 'Void Swashbuckle.Swagger.SchemaRegistry..ctor(Newtonsoft.Json.JsonSerializerSettings, System.Collections.Generic.IDictionary
2<System.Type,System.Func
1<Swashbuckle.Swagger.Schema>>, System.Collections.Generic.IEnumerable1<Swashbuckle.Swagger.ISchemaFilter>, System.Collections.Generic.IEnumerable
1<Swashbuckle.Swagger.IModelFilter>, Boolean, System.Func`2<System.Type,System.String>, Boolean, Boolean)'.","ExceptionType":"System.MissingMethodException","StackTrace":" at Swashbuckle.OData.ODataSwaggerProvider.GetSwagger(String rootUrl, String apiVersion)\r
- Expected behavior: no exception ;)
It sounds like Swashbuckle.Swagger.SchemaRegistry is really to 'blame' because the public constructor in a non-backwards-compatible way. One fix that might prevent this from being a problem again is a static factory method on SchemaRegistry so that developers aren't as tempted to change the constructor (or get a build error if they do ;). Then in OdataSwaggerProvider.GetSwagger, the call would be:
var schemaRegistry = SchemaRegistry.Create(...)
A constructor overload would work as well. Either should probably have copious comments to remind Swashbuckle.Core developers that Swashbuckle.OData depends on the overload...
Alternatively, some change to OdataSwaggerProvider.GetSwagger to use the newer constructor, though that would then mean the packaging should require .Core >= 5.4.0, and the risk would remain of SchemaRegistry changing in 5.5.0 ;)
from swashbuckle.odata.
I am also getting this issue still with
Swashbuckle.Core" version="5.4.0"
Swashbuckle.OData" version="2.18.4"
Does anyone know a functional combination to use of older versions?
from swashbuckle.odata.
@codegrue The latest working combo is:
Swashbuckle.Core" version="5.3.2"
Swashbuckle.OData" version="2.18.3"
from swashbuckle.odata.
@brutaldev Just tried that and now I am getting a "Method not found" error in the Microsoft.OData namespace (v7.0.0). I wonder if I need an older version of this also?
Specifically:
Method not found: 'Microsoft.OData.Edm.IEdmModel System.Web.OData.Routing.ODataPathRouteConstraint.get_EdmModel()'.",
"ExceptionType":"System.MissingMethodException",
"StackTrace":" at Swashbuckle.OData.Descriptions.ODataRouteExtensions.GetEdmModel(ODataRoute oDataRoute)...
from swashbuckle.odata.
we have last I looked at this a chain of depends on old versions of everything.....
In My project I have a set of working packages and I will not change them until I know for sure this has been fixed.
this is the problem of multiple packages from different teams and no one having time to manage the different interfaces and specs.
in my project what I have is:
Swashbuckle 5.3.2
Swashbuckle.OData 2.18.2
Microsoft.OData.Core 6.15
Microsoft.ASpNet.OData 5.9.1
Flurl 0.1.0
each have updates but I can't use them due to different conflicts with the updated packages.
for now use the versions I have given and it should all work.
that's my $0.02 on this...
from swashbuckle.odata.
Thank you. I reverted everything and it broke RESTier. Ugh. Wish Swashbuckle would support the latest APIs for these other libraries.
from swashbuckle.odata.
OData 7 breaks everything, don't upgrade to that yet until people have had a chance to update their libs.
This is the version combo I use, as new as possible without anything breaking
Swashbuckle 5.3.2
Swashbuckle.OData 2.18.4
Microsoft.OData.Core 6.15
Microsoft.ASpNet.OData 5.9.1
Flurl 1.1.2
from swashbuckle.odata.
@brutaldev : will try the updated versions you have when I can and see if they also are ok on my project.
@codegrue : RESTier, i tried that at one point but was not able to do what I needed.
in my system i have a generic class that does most of the work and make sure that some key columns in the database are updated on each update etc.... RESTier looked nice but when I got it I found it was not really done, needed more "Cooking time" :--)
from swashbuckle.odata.
I'll update Swashbuckle.OData to constrain the versions per @brutaldev. Thanks for researching, everyone.
from swashbuckle.odata.
Dependency versions now constrained in v2.18.5: https://www.nuget.org/packages/Swashbuckle.OData/2.18.5
Will close this ticket in a few days unless I hear of any issues. Thanks!
from swashbuckle.odata.
@rbeauchamp When updating to 2.18.5, it crashes IIS Express with the following error: https://brutaldev.com/download/SODATA-2185-Error.png
Only this combination seems to work well:
Swashbuckle 5.3.2
Swashbuckle.OData 2.18.4
Microsoft.OData.Core 6.15
Microsoft.ASpNet.OData 5.9.1
Flurl 1.1.2
Your NuGet package should be constrained with something like this:
>= 6.1.5 and < 7.0.0 Microsoft.OData.Core
>= 5.7.0 < 6.0.0 Microsoft.ASpNet.OData (6.0.0 relies on OData 7.0.0)
< 5.4.0 Swashbuckle
from swashbuckle.odata.
Sorry, that error is my bad. Don't have CodeContracts installed on my new machine. :-(
I'll get a new package built and pushed.
from swashbuckle.odata.
Ok. Package v2.18.5 has been de-listed.
Please retry with v2.18.6.
from swashbuckle.odata.
@rbeauchamp Installed and tested. The following combination can now be used (the NuGet package does not constrain things enough to avoid going up in major versions):
Swashbuckle 5.3.2
Swashbuckle.OData 2.18.6
Microsoft.OData.Core 6.15
Microsoft.ASpNet.OData 5.9.1
Flurl 1.1.2
from swashbuckle.odata.
@brutaldev Thanks for testing! Looks like I need to constrain Microsoft.AspNet.OData too. Then we should be all set.
from swashbuckle.odata.
@rbeauchamp I added my suggested constraints above based on what's out there right now:
>= 6.1.5 and < 7.0.0 Microsoft.OData.Core
>= 5.7.0 < 6.0.0 Microsoft.AspNet.OData (6.0.0 relies on OData 7.0.0)
< 5.4.0 Swashbuckle
Your current constraints:
Flurl (< 2.0.0) <- Good
Microsoft.AspNet.OData (>= 5.7.0) <- Not Good, needs to be < 6.0.0 because 6.0.0 relies on MS OData 7+
Microsoft.AspNet.WebApi.Client (>= 5.2.3) <- Good, but probably safer to also be < 6.0.0
Microsoft.AspNet.WebApi.Core (>= 5.2.3) <- Good, but probably safer to also be < 6.0.0
Microsoft.AspNet.WebApi.WebHost (>= 5.2.3) <- Good, but probably safer to also be < 6.0.0
Newtonsoft.Json (>= 7.0.1) <- Good
Microsoft.OData.Core (= 6.15.0) <- Bit too strict since these have always been safe, rather go < 7.0.0*
Microsoft.OData.Edm (= 6.15.0) <- Bit too strict since these have always been safe, rather go < 7.0.0*
Microsoft.Spatial (= 6.15.0) <- Bit too strict since these have always been safe, rather go < 7.0.0*
Swashbuckle.Core (= 5.3.2) <- Bit too strict, only 5.4.0 breaks thing, probably safe to go < 5.4.0
from swashbuckle.odata.
Great. Thanks for the recommendations. I'll apply those constraints.
from swashbuckle.odata.
No problem, would probably have been faster to just PR those changes for you, but I'm feeling wrecked today and need some sleep... Thanks again for the great lib, I rely on it so much I'll jump through hoops and stay on older versions of things just to keep this working.
from swashbuckle.odata.
You're welcome. Thanks, this is fine. Go get some sleep! ;-)
On Tue, Sep 27, 2016, 11:44 AM Werner van Deventer [email protected]
wrote:
No problem, would probably have been faster to just PR those changes for
you, but I'm feeling wrecked today and need some sleep... Thanks again for
the great lib, I rely on it so much I'll jump through hoops and stay on
older versions of things just to keep this working.—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#68 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAcwbXMdYCx1APQ-Bs3XpoPtfmGAVxs6ks5quWQOgaJpZM4HaLPH
.
from swashbuckle.odata.
Latest package constraints per @brutaldev are avialable in https://www.nuget.org/packages/Swashbuckle.OData/2.18.8
from swashbuckle.odata.
Related Issues (20)
- SchemaRegistryExtensions.GetPropertyNameForEdmModel returns wrong Edm Property name HOT 2
- Calling for Maintainers HOT 6
- Swagger generation resulting in error. Error thrown from SwaggerRouteStrategy.cs line 62
- AdjustRelativePathForStringParams is not working case-insensitive (param names)
- Method not found: 'Flurl.Url Flurl.Url.AppendPathSegment(System.Object)' HOT 1
- Precondition Failure
- Swagger docs don't have type information for Get method when it returns IHttpActionResult HOT 2
- Add custom property resolver to 4.0.0
- Unbound actions generate invalid swagger HOT 2
- Entity bound actions can have ODataActionParameters type parameters only
- Custom type parameters for OData functions HOT 1
- Exploring different version at the same time throw an error.
- Support for Microsoft.AspNet.OData 7? HOT 10
- Swashbuckle.OData.Core throws Specified argument was out of the range of valid values exception and failing to generate swagger ui HOT 1
- Need Help OData V4 REST Web API Documentation HOT 4
- Swashbuckle.OData.Core is too slow, consume 60% memory while open swagger in chrome browser HOT 4
- OData Web API Controller Summary not showing in swagger
- Swashbuckle.OData compatibility with OData V3 Controllers HOT 1
- Swagger generation fails for Entities having DataContractAttribute fails with "Sequence contains no matching element" when used in OData Actions. HOT 1
- Accurate OData response schema
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from swashbuckle.odata.