Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

Swagger Error After Deploy #2557


User avatar
0
cangunaydin created

Hello, After i have deployed my asp.net core project i am getting an error on the swagger page. I didn't understand what does it mean or why am i getting it? Any idea about it?

{"schemaValidationMessages":[{"level":"error","domain":"validation","keyword":"oneOf","message":"instance failed to match exactly one schema (matched 0 out of 2)","schema":{"loadingURI":"http://swagger.io/v2/schema.json#","pointer":"/definitions/parametersList/items"},"instance":{"pointer":"/paths/~1api~1TokenAuth~1ImpersonatedAuthenticate/post/parameters/0"}}]}

11 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    Did you updated any nuget package ? And is this happening only on the deplyoed server but not on local machine ?

    Thanks.

  • User Avatar
    0
    cangunaydin created

    it is only happening in deployed server, not in my local

  • User Avatar
    0
    cangunaydin created

    I didn't update any nuget package by the way.

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    Can you send your swagger json schema to us via email ? Are you using azure or any other cloud service ?

    Thanks

  • User Avatar
    0
    cangunaydin created

    Hello i have sent the document yesterday. Did you get it? Thanks for the help.

  • User Avatar
    0
    DennisAhlin created

    I get this too, I'm using Azure.

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    Thanks, I got the document. Can you add [FromQuery] to ImpersonatedAuthenticate's input and LinkedAccountAuthenticate's input and try again ?

    ImpersonatedAuthenticate([FromQuery]string impersonationToken)
    

    and

    LinkedAccountAuthenticate([FromQuery]string switchAccountToken)
    
  • User Avatar
    0
    cangunaydin created

    Hello, This doesn't make the problem disappear still i am getting an error now the server side is online you can check the error from this url. Can publishing the project in debug mode be the reason?

    [http://online.swagger.io/validator/debug?url=http://miconfserver.bitlogic.se/swagger/v1/swagger.json])

  • User Avatar
    0
    ismcagdas created
    Support Team

    Ok, let us check this and get back to you. I'm not sure if it is related to debug mode publish or not.

    We will try to test this soon.

  • User Avatar
    0
    cangunaydin created

    Hello, is it any progress on this topic?

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @cangunaydin,

    We couldn't find a solution to this but let us check this again for the next release. I have created an issue for it here <a class="postlink" href="https://github.com/aspnetzero/aspnet-zero-core/issues/112">https://github.com/aspnetzero/aspnet-ze ... issues/112</a>.