Hi Ron,

I'm using this version of swagger 
core https://mvnrepository.com/artifact/io.swagger/swagger-core/1.5.12 and 
the latest version of Swagger UI. 

Here is the swagger doc:

{
  "swagger" : "2.0",
  "info" : {
    "description" : "This is an API for marketing purposes",
    "version" : "1.0.0",
    "title" : ""
  },
  "tags" : [ {
    "name" : "PromoCodeProductsResource"
  }, {
    "name" : "PromoCodesResource"
  } ],
  "schemes" : [ "http", "https" ],
  "paths" : {
    "/promocodeproducts/getPromoCodeProductsByPromoCode/{promocode}" : {
      "get" : {
        "tags" : [ "PromoCodeProductsResource" ],
        "summary" : "Returns a promo code product for the specified promo 
code",
        "description" : "",
        "operationId" : "getPromoCodeProductsByPromoCode",
        "produces" : [ "application/json" ],
        "parameters" : [ {
          "name" : "promocode",
          "in" : "path",
          "description" : "promocode",
          "required" : true,
          "type" : "string"
        } ],
        "responses" : {
          "200" : {
            "description" : "successful operation",
            "schema" : {
              "$ref" : "#/definitions/PromoCodeProductsResponse"
            }
          },
          "400" : {
            "description" : "Invalid Promo Code supplied"
          },
          "404" : {
            "description" : "Promo Code Products not found"
          }
        }
      }
    },
    "/promocodes/getActivePromoCodes/{saleschannel}" : {
      "get" : {
        "tags" : [ "PromoCodesResource" ],
        "summary" : "List of all promo codes for the specified sales 
channel",
        "description" : "",
        "operationId" : "getActivePromoCodes",
        "produces" : [ "application/json" ],
        "parameters" : [ {
          "name" : "saleschannel",
          "in" : "path",
          "description" : "saleschannel",
          "required" : true,
          "type" : "string"
        } ],
        "responses" : {
          "200" : {
            "description" : "successful operation",
            "schema" : {
              "$ref" : "#/definitions/PromoCodeResponse"
            }
          },
          "400" : {
            "description" : "Invalid Sales Channel supplied"
          },
          "404" : {
            "description" : "Promo Codes not found"
          }
        }
      }
    }
  },
  "securityDefinitions" : {
    "basicAuth" : {
      "description" : "",
      "type" : "basic"
    }
  },
  "definitions" : {
    "PromoCodeProductsResponse" : {
      "type" : "object",
      "properties" : {
        "productCode" : {
          "type" : "string"
        },
        "promoCodeProducts" : {
          "type" : "array",
          "description" : "List of Promo Codes",
          "items" : {
            "$ref" : "#/definitions/JsonPromoCodeProduct"
          }
        }
      }
    },
    "PromoCodeResponse" : {
      "type" : "object",
      "properties" : {
        "promoCodes" : {
          "type" : "array",
          "items" : {
            "$ref" : "#/definitions/JsonPromoCode"
          }
        }
      }
    },
    "JsonPromoCodeProduct" : {
      "type" : "object",
      "properties" : {
        "productCode" : {
          "type" : "string",
          "description" : "Product Code"
        },
        "lineSpeed" : {
          "type" : "integer",
          "format" : "int32",
          "description" : "Line Speed"
        },
        "productName" : {
          "type" : "string",
          "description" : "Product Name"
        },
        "productDescription" : {
          "type" : "string",
          "description" : "Product Description"
        },
        "productRate" : {
          "type" : "number",
          "format" : "double",
          "description" : "Product Rate"
        },
        "productDiscountType" : {
          "type" : "string",
          "description" : "Product Discount Type"
        },
        "productDiscountAmount" : {
          "type" : "number",
          "format" : "double",
          "description" : "Product Discount Amount"
        },
        "productDiscountPeriod" : {
          "type" : "integer",
          "format" : "int32",
          "description" : "Product Discount Period"
        },
        "productDiscountSequence" : {
          "type" : "integer",
          "format" : "int32",
          "description" : "Product Discount Sequence"
        },
        "onceOffCharge" : {
          "type" : "boolean",
          "description" : "Has Once Off Charge",
          "default" : false
        },
        "contractPeriod" : {
          "type" : "integer",
          "format" : "int32",
          "description" : "Product Contract Period"
        }
      },
      "description" : "Promo Code Product resource representation"
    },
    "JsonPromoCode" : {
      "type" : "object",
      "properties" : {
        "promoCode" : {
          "type" : "string",
          "description" : "promo code"
        },
        "promoCodeDescription" : {
          "type" : "string",
          "description" : "The promotional code description"
        },
        "contractPeriod" : {
          "type" : "integer",
          "format" : "int32",
          "description" : "The contract period of the promoProduct"
        }
      },
      "description" : "Promo Code resource representation"
    }
  }
}

On Wednesday, March 8, 2017 at 6:26:10 PM UTC+2, Ron wrote:
>
> We’d need to know the version of swagger-ui you’re using and a spec that 
> reproduces the problem.
>
>  
>
>  
>
> *From: *<[email protected] <javascript:>> on behalf of "
> [email protected] <javascript:>" <[email protected] <javascript:>>
> *Reply-To: *"[email protected] <javascript:>" <
> [email protected] <javascript:>>
> *Date: *Wednesday, 8 March 2017 at 5:34
> *To: *Swagger <[email protected] <javascript:>>
> *Subject: *Swagger-ui does not use the right produces consumes 
> application/json
>
>  
>
> Hi there, 
>
>  
>
> My Swagger UI used to do the API calls correctly, but for some reason now 
> its returning server can't produce text/html. the curl command produced by 
> swagger is: curl -X GET --header 'Accept: text/html' --header 
> 'Authorization: Basic XXXXXXX' '
> http://localhost:8008/test/getValues/pathParam'
>
>  
>
> Thanks in advance!
>
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Swagger" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected] <javascript:>.
> For more options, visit https://groups.google.com/d/optout.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Swagger" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to