Swagger somehow adds some stuff I like to be removed. All examples shown are simplified.
I have a WebAPI with a controller operation which returns JSON-Schemas. It looks like this:
[SwaggerResponseExample((int)HttpStatusCode.OK, typeof(ServiceDemandContractExamplesProvider))]
public IActionResult GetContract(string serviceName)
{
return Content(jsonSchemaAsString, "application/json")
}
Then I have a Swagger Example for that Operation looking like this:
public class ServiceDemandContractExamplesProvider : IMultipleExamplesProvider<JsonDocument>
{
public IEnumerable<SwaggerExample<JsonDocument>> GetExamples()
{
JsonDocument jsonDocument;
// Build a JsonDocument which represents a JSON schema.
// ....
// check the JSON-String outcome with debugger:
// The $ref properties inside the schema points to the correct position in the schema itself,
// no '/swagger/v1/swagger.json' content so far
yield return SwaggerExample.Create("Example1", jsonDocument);
}
}
When I now create an example like this (simplified):

The SwaggerUI shows me the example like that:

How can I get rid of that /swagger/v1/swagger.json in the $ref properties?