Swashbuckle.AspNetCore.Annotations OperationId ignored - swagger

I've upgraded my code to use Swashbuckle.AspNetCore 3.0.0. (
Swashbuckle.AspNetCore.Annotations, Swashbuckle.AspNetCore.Swagger, Swashbuckle.AspNetCore.SwaggerGen, Swashbuckle.AspNetCore.SwaggerUI all are 3.0.0).
And now when I use [SwaggerOperation(OperationId = "MyUniqueId")]
the operationId value is not set, but auto generated.
Any idea how if I am doing something wrong or is it just a new version bug?

Just ran into the same issue.
After looking at the documentation, found the solution.
You need to add the line c.EnableAnnotations() in your startup file, more precisely,
services.AddSwaggerGen(c =>
{
c.EnableAnnotations();
More details are here.
Hope this helps you to!

Related

MockWebServer: java.lang.NoSuchMethodError

Trying MockWebServer for the first time on a Groovy/Spring project that uses Spock for unit testing.
I added MockWebServer dependencies as directed (I had to add the second line myself to avoid errors, but it's not documented:
testImplementation("com.squareup.okhttp3:mockwebserver:4.0.0")
testImplementation("org.jetbrains.kotlin:kotlin-stdlib:1.3.40")
I have a basic Spock test that looks like this:
def 'server'() {
setup:
MockWebServer server = new MockWebServer()
expect:
server
}
But it fails with this output:
java.lang.NoSuchMethodError: okhttp3.internal.Util.immutableListOf([Ljava/lang/Object;)Ljava/util/List;
at okhttp3.mockwebserver.MockWebServer.<init>(MockWebServer.kt:176)
Is there another dependency I'm missing? Does MockWebServer not play well with Groovy and Spock?
For what it's worth, using version 3.1.4 seems to work:
testImplementation("com.squareup.okhttp3:mockwebserver:3.14.2")
(I'm a first time user of MockWebServer)
Thank you!
Try adding this:
testImplementation("com.squareup.okhttp3:mockwebserver:4.0.0")
testImplementation("com.squareup.okhttp3:okhttp:4.0.0")
With MockWebServer your OkHttp dependency must be the same version.
I got the same problem, I found the solution in version, just change the version to "3.7.0" and it's work fine.
there is some discussion about version changing to "3.4.1" but this version got the problem (Cannot inherit from final class) that discussed at this issue :
https://github.com/andrzejchm/RESTMock/issues/56
so the safest version is "3.7.0" :D
just notice that both versions should be the same..
change your to dependencies to below:
//mock retrofit
testImplementation("com.squareup.okhttp3:mockwebserver:3.7.0")
testImplementation("com.squareup.okhttp3:okhttp:3.7.0")
//if your source code is java
testImplementation("org.jetbrains.kotlin:kotlin-stdlib:1.3.40")

F# tryHead is not defined

I am using Seq.tryHead but I am getting an error
let maybeTagDatabaseModel = Seq.tryHead tagSeq
error
error FS39: The value, constructor, namespace or type 'tryHead' is not defined
Does anyone have suggestions on how to fix? Thanks
For future visitors
The problem seemed to be this dependency "FSharp.Interop.Dynamic": "3.0.0" in the project.json file.
Two of my projects were on version less than 4. Upgraded those and they work now.

TwitterCredentials.SetCredentials from tweetinvi not found

i installed tweetinvi but the TwitterCredentials.SetCredentials is not found.
Install-Package TweetinviAPI
How can i solve this.
You're using an old Tweetinvi code.
Tweetinvi break compatibility since version 0.9.9.5. Instead of "TwitterCredentials.SetCredentials" you should now use "Auth.SetUserCredentials"
plaese note that the parameters order has also been changed!
Try this:
Auth.SetUserCredentials("CONSUMER_KEY", "CONSUMER_SECRET", "ACCESS_TOKEN", "ACCESS_TOKEN_SECRET");
For more options, see https://github.com/linvi/tweetinvi/wiki/Credentials
Try this one:
TwitterCredentials twitterCredentials = new TwitterCredentials("<consumerKey>", "<consumerSecret>", "<accessToken>", "<token_secret">);
Hope this will help.

Deprecated message when adding MIME extension

I've added the following into initializers/mime_types.rb:
text_plain = MIME::Types["application/octet-stream"].first
text_plain.extensions << "fmf"
MIME::Types.index_extensions text_plain`
This works with Paperclip but I get the following message when running rspec:
MIME::Types#index_extensions is deprecated and will be private.
Are there any other methods of adding a new extension without using the above deprecated method?
According to the thread at Thoughtbot Paperclip Issue #1737, you may be able to use the following pattern to avoid the deprecation warning.
text_plain = MIME::Types["application/octet-stream"].first
text_plain.add_extensions "fmf"
Sorry this answer may not be helpful a year later, but perhaps someone else will find it useful.

SugerCRM Warning: Creating default object from empty value

when i am trying to edit field from sugerCRM editor then i am getting this issue.
even i try to use this patch as well as a solution for this error but still getting this issue.
https://github.com/sugarcrm/sugarcrm_dev/pull/143
( ! ) Warning: Creating default object from empty value in C:\xampp\htdocs\crm\trunk\modules\ModuleBuilder\views\view.modulefield.php on line 151
I found the other answer almost correct but it generated further warnings, this seemed to solve them completely for me:
if(!isset($module->mbvardefs) || is_null($module->mbvardefs)) {
$module->mbvardefs = new stdClass();
}
$module->mbvardefs->vardefs = $dictionary[$objectName];
It is kind of frustrating that SugarCRM comes with bugs like this when using modern versions of PHP..
Thanks friend but this issue is being resolved we just need to replace line number 151 in view.modulefield.php file with
if(!isset($module->mbvardefs) || is_null($module->mbvardefs)) {
$module->mbvardefs = new stdClass();
}
In order for this to work for me, I found that the inserted statement needed to come AFTER the original problem line instead of before it, but big thanks for the solution. This has solved a big headache for me that no-one else seems to have had a pill for!

Resources