How do I create service contracts in webapi

1

I'm doing an API in .Net Core 2.0 and I need to know how to create a service contract based on the SOA Contract Centralization

link

  

In WCF, the WSDL is created and the classes are marked with [ServiceContract] and   [DataContract] Is it similar in a REST API?

    
asked by joac aguilar 16.05.2018 в 07:29
source

1 answer

2

Take a look at the specification OpenAPI which is the way to define "these contracts" (as is WSDL)

For example, one of the tools we use in WebAPI to define our APIs and make them more "readable for us humans is" Swagger (la more popular), only with decorators generates the necessary scheme so that it can be read in these tools. That is, generates the contract.

You can also see Autorest which is the tool that with an OpenAPI specification generates the client to access this API! That is, to write less code;)

Links that can help you

answered by 19.05.2018 в 19:22