0

I do not know how to add the example models with the latest swagger (swashbuckle.aspnetcore4.0.1) NuGet package.

earlier I used to do with this, but i donot get argument with the latest interface

 public class SwaggerExamplesSchemaFilter : ISchemaFilter
 {

    public void Apply(Schema schema, SchemaRegistry schemaRegistry, Type type)
    {}
 }

I need the latest usage to create the example model

2 Answers 2

1

I found the answer here for the latest package

https://github.com/domaindrivendev/Swashbuckle.AspNetCore#enrich-schema-metadata

Sign up to request clarification or add additional context in comments.

Comments

0

Unless I've missed an update to Swashbuckle, the sort of official unofficial way to add examples is via the Swashbuckle.AspNetCore.Examples NuGet package. I'm sure you could roll your own, if you really wanted to, but you'd likely just create something like this anyways. In other words, there's nothing I'm aware directly built-in to add examples.

1 Comment

the repository you mentioned is uninformative for the latest package usage

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.