Change parameter type in SwaggerWcf

622 Views Asked by At

Swagger allows setting the parameter type but with SwaggerWcf I can't edit this file, it's generated. It's set to body by default, but I need it to be path.

One might think SwaggerWcfParameterAttribute would allow setting this. But it only allows Description and Required.

How can it be set specifically?

1

There are 1 best solutions below

2
Abel Silva On BEST ANSWER

Did you try using the format in the sample service?

https://github.com/abelsilva/swaggerwcf/blob/master/src/SwaggerWcf.Test.Service/IStore.cs#L48

    [SwaggerWcfPath("Get book author", "Retrieve the author of a book using the book id")]
    [WebGet(UriTemplate = "/books/{id}/author", BodyStyle = WebMessageBodyStyle.Bare, RequestFormat = WebMessageFormat.Json, ResponseFormat = WebMessageFormat.Json)]
    [OperationContract]
    Author ReadBookAuthor(string id);

The parameter id from the path will be passed to the function