A First Example: An API with a single endpoint HelloWorldEndpoint that exposes a single operation called sayHello can be modelled as this:
API description HelloMDSLWorld
data type SampleDTO {ID, D<string>}
endpoint type HelloWorldEndpoint
exposes
operation sayHello
expecting payload "in": D<int>
delivering payload SampleDTO
API provider HelloWorldAPIProvider
offers HelloWorldEndpoint
at endpoint location "http://localhost:8000"
via protocol HTTP
binding resource HomeResource at "/"
operation sayHello to POST
API client HelloWorldAPIClient
consumes HelloWorldEndpoint
from HelloWorldAPIProvider
via protocol HTTP
sayHello accepts a single scalar string value D
In addition to the endpoint type (a.k.a. service contract) HelloWorldEndpoint, an API client and an API provider working with this contract are defined (and bound to HTTP, a single home resource in this simple case).
Take a look at Hello World in Swagger/OpenAPI Specification in comparison. You can find such contract specification example here (note: this OpenAPI specification contains a few more details about the HTTP binding of the abstract contract).
Last modified 07 October 2024