Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Swaggerwcf doesn't support ServiceContracts with the same methodsname.  #197

@gtame

Description

@gtame

The Servicecontract

`
[ServiceContract]
public interface IMessage
{

    [WebGet(UriTemplate = "/translations", BodyStyle = WebMessageBodyStyle.Bare)]
     string GetText(string classCode, long code);
    [WebGet(UriTemplate = "/translations", BodyStyle = WebMessageBodyStyle.Bare)]
    string GetText(string classCode, long code, string languageIso);

}
`

The service Implementation

`

   public class MessagesService : ESPBaseService, ESP.Contracts.Data.IMessage
  {
    [SwaggerWcfTag("Messages")]
    [SwaggerWcfPath("GetText", "Get messageText with current language")]
    string IMessage.GetText(string classCode, long code)
    {

        throw new NotImplementedException();
    }
    [SwaggerWcfTag("Messages")]
    [SwaggerWcfPath("GetText", "Get messageText with the current language in laguageIso")]
    string IMessage.GetText(string classCode, long code, string languageIso)
    {
        throw new NotImplementedException();
    }

}

`
The result:

swagger

The swagger.json have only one GetText section:

swagger json

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions