{"id":16481872,"url":"https://github.com/angularsen/repro-aspnetcore-19510","last_synced_at":"2025-02-28T18:19:15.403Z","repository":{"id":66294986,"uuid":"452609720","full_name":"angularsen/repro-aspnetcore-19510","owner":"angularsen","description":"Reproduce https://github.com/dotnet/aspnetcore/issues/19510","archived":false,"fork":false,"pushed_at":"2022-01-27T09:15:38.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-11T10:37:33.598Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/angularsen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-01-27T09:00:12.000Z","updated_at":"2022-01-27T09:01:37.000Z","dependencies_parsed_at":"2023-02-25T23:00:14.119Z","dependency_job_id":null,"html_url":"https://github.com/angularsen/repro-aspnetcore-19510","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/angularsen%2Frepro-aspnetcore-19510","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/angularsen%2Frepro-aspnetcore-19510/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/angularsen%2Frepro-aspnetcore-19510/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/angularsen%2Frepro-aspnetcore-19510/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/angularsen","download_url":"https://codeload.github.com/angularsen/repro-aspnetcore-19510/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241198943,"owners_count":19926554,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-11T13:08:55.362Z","updated_at":"2025-02-28T18:19:15.380Z","avatar_url":"https://github.com/angularsen.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"﻿# Repro dotnet/aspnetcore/issues/19510\n\n[Media type application/problem+json lost in combination with ProducesAttribute - PR 19510 - dotnet/aspnetcore](https://github.com/dotnet/aspnetcore/issues/19510)\n\n```shell\ndotnet run\n```\n\n### ✅ Test 1 - Problem() without [Produces]\nReturns `application/problem+json` as expected.\n\n```shell\ncurl -i http://localhost:5106/test/1\n```\n\n```http request\nHTTP/1.1 500 Internal Server Error\nContent-Type: application/problem+json; charset=utf-8\nDate: Thu, 27 Jan 2022 07:53:16 GMT\nServer: Kestrel\nTransfer-Encoding: chunked\n\n{\"type\":\"https://tools.ietf.org/html/rfc7231#section-6.6.1\",\"title\":\"An error occurred while processing your request.\",\"status\":500,\"detail\":\"Test1 ✅ - Problem(string) without ProducesAttribute =\u003e returns application/problem+json. Assembly: C:\\\\Program Files\\\\dotnet\\\\shared\\\\Microsoft.AspNetCore.App\\\\6.0.1\\\\Microsoft.AspNetCore.Mvc.Core.dll\",\"traceId\":\"00-f837e61b4f3fe38e1326d4b736ce4b1b-5f42df452447a45b-00\"}\n```\n\n### ❌ Test 2 - Problem() with [Produces(\"application/json\")]\nReturns `application/json` instead of expected `application/problem+json`.\n\n```shell\ncurl -i http://localhost:5106/test/2\n```\n\n```http request\nHTTP/1.1 500 Internal Server Error\nContent-Type: application/json; charset=utf-8\nDate: Thu, 27 Jan 2022 07:54:47 GMT\nServer: Kestrel\nTransfer-Encoding: chunked\n\n{\"type\":\"https://tools.ietf.org/html/rfc7231#section-6.6.1\",\"title\":\"An error occurred while processing your request.\",\"status\":500,\"detail\":\"Test2 ❌ - Problem(string) with [Produces(\\\"application/json\\\")] =\u003e incorrectly returns application/json instead of application/problem+json. Assembly: C:\\\\Program Files\\\\dotnet\\\\shared\\\\Microsoft.AspNetCore.App\\\\6.0.1\\\\Microsoft.AspNetCore.Mvc.Core.dll\",\"traceId\":\"00-7898b5db7c72df8b1589c0776c857321-1145d480210ea6e5-00\"}\n```\n\n### ❌ Test 3 - Problem() with [Produces(\"application/json\", \"application/problem+json\")]\nReturns `application/json` instead of expected `application/problem+json`.\n\n```shell\ncurl -i http://localhost:5106/test/3\n```\n\n```http request\nHTTP/1.1 500 Internal Server Error\nContent-Type: application/json; charset=utf-8\nDate: Thu, 27 Jan 2022 08:50:00 GMT\nServer: Kestrel\nTransfer-Encoding: chunked\n\n{\"type\":\"https://tools.ietf.org/html/rfc7231#section-6.6.1\",\"title\":\"An error occurred while processing your request.\",\"status\":500,\"detail\":\"Test3 ❌ - Problem(string) with [Produces(\\\"application/json\\\", \\\"application/problem+json\\\")] =\u003e incorrectly returns application/json instead of application/problem+json. Assembly: C:\\\\Program Files\\\\dotnet\\\\shared\\\\Microsoft.AspNetCore.App\\\\6.0.1\\\\Microsoft.AspNetCore.Mvc.Core.dll\",\"traceId\":\"00-4e825df690029941d19792a19b6e1346-1e417b4f47ca76cf-00\"}\n```\n\n### ❌ Test 4 - Problem() with [Produces(\"application/problem+json\", \"application/json\")]\nReturns `application/problem+json`, but then `Ok(object)` also returns `application/problem+json` instead of expected `application/json`.\n\n```shell\ncurl -i http://localhost:5106/test/4\n```\n\n```http request\nHTTP/1.1 500 Internal Server Error\nContent-Type: application/problem+json; charset=utf-8\nDate: Thu, 27 Jan 2022 07:55:05 GMT\nServer: Kestrel\nTransfer-Encoding: chunked\n\n{\"type\":\"https://tools.ietf.org/html/rfc7231#section-6.6.1\",\"title\":\"An error occurred while processing your request.\",\"status\":500,\"detail\":\"Test4 ❌ - Problem(string) with [Produces(\\\"application/problem+json\\\", \\\"application/json\\\")] =\u003e returns content-type application/problem+json, but then Ok(string) also returns application/problem+json. Assembly: C:\\\\Program Files\\\\dotnet\\\\shared\\\\Microsoft.AspNetCore.App\\\\6.0.1\\\\Microsoft.AspNetCore.Mvc.Core.dll\",\"traceId\":\"00-cb867abbe8d88fbced809ff7764199fe-bb8a5378a54e6789-00\"}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fangularsen%2Frepro-aspnetcore-19510","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fangularsen%2Frepro-aspnetcore-19510","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fangularsen%2Frepro-aspnetcore-19510/lists"}