(implementation). Yet (DeRemer and Kron, 1975)
shows the advantages of using different languages for
programming-in-the-large and for programming-in-
the-small. The first process makes it possible to par-
tially leverage these advantages, but lacks the ability
to keep the OpenAPI model and the implementation
aligned throughout the life of the project. Indeed, im-
plementation is often obtained by a projection of the
model that is then manually modified to implement
business logic. Any following model evolution needs
to be projected again which would require manual mo-
difications to be re-applied from the beginning. This
work is intended to go beyond this limitation.
Contribution.
We extend the approach presented
in (Sferruzza et al., 2018). It consisted of a meta-
model designed to express a high-level representation
of web services in order to provide support such as
visualization, verification and code generation. We
add the possibility to better specify service parameters,
improve the type system and make re-usability easier
by adding a mechanism to bind variables in compo-
nent definitions and in their equivalents in instances’
contexts.
We introduce extensions to OpenAPI 3.0 (Sfer-
ruzza, 2018); we take advantage of them to make it
possible to add the various information of our models
of web services into any OpenAPI model. This allows
us to merge our meta-model with one supported by the
industry and to polish it by removing parts that alre-
ady exist in OpenAPI while benefiting mutually of our
SWSG tool or of any tool designed for OpenAPI 3.0.
We propose a prototype
3
to build consistent web
services from an extended OpenAPI 3.0 model. This
tool is an enhanced version of the tool we proposed
in (Sferruzza et al., 2018), that could (i) check model
consistency and (ii) generate source code of working
web services from a given valid model. We improve
model consistency verification and code generation,
according to the recent evolutions of the meta-model.
Then we add support for OpenAPI 3.0 models that use
our extensions. The prototype converts these models
to models that are compliant with our meta-model so
they can benefit of our tooling.
The article is structured as follows. Section 2 pre-
sents related work. Section 3 shows, through an exam-
ple project, how OpenAPI is usually used in the indu-
stry. Section 4 defines extensions to the OpenAPI 3.0
specification. Section 5 improves the meta-model pre-
sented in (Sferruzza et al., 2018). Section 6 presents
a new process to use these extensions in SWSG and
3
https://gitlab.startup-palace.com/research/swsg
automatically generate web services from an OpenAPI
model. Section 7 re-runs the example in Section 3
using the newly introduced tools. Finally, Section 8
concludes the article with some lessons and future
work.
2 RELATED WORK
The use of MDE for development and automatic ge-
neration of web services or web applications is not a
new topic (Bernardi et al., 2012; Bernardi et al., 2016;
Scheidgen et al., 2016). Indeed, this work is itself
built on top of the approach of SWSG (Sferruzza et al.,
2018) and REIFIER (Rocheteau and Sferruzza, 2016).
SWSG shares the meta-modeling approach with
tools such as M3D (introduced in (Bernardi et al.,
2012) and extended in (Bernardi et al., 2016)) that
also focus on building web services using MDE. One
of the main differences between SWSG and M3D is
that SWSG was developed with a focus on design-time
support. For example, it allows to automatically verify
properties about the structural consistency of models.
Even if SWSG is definitely related to existing stan-
dards such as BPEL (Fu et al., 2004) or WSDL, our
approach differs on several aspects. First, we want to
avoid the shortcomings described in (Gronmo et al.,
2004), that is WSDL models contain too much techni-
cal details and are difficult to understand for humans.
Indeed, our meta-model is simpler and less expressive
than WSDL or BPEL. Second, this allows SWSG to
provide more support to users (the balance between
flexibility and support is discussed in (Aalst et al.,
2009)). Finally, SWSG now relies on OpenAPI.
OpenAPI is an active and growing industry stan-
dard that is also involved in various research areas.
In (Cao et al., ), it was chosen for its popularity over
WADL and other industry standards in order to auto-
matically transform plain HTML documentations of
web services to a machine-readable format. Moreover,
(Cremaschi and De Paoli, 2017) provides a great state
of the art of service description formats (which seems
to be an updated version of the work proposed in (Tsou-
roplis et al., 2015, §3.2)) that brings out OpenAPI as
the most promising choice at the moment and enriches
it with semantic annotations. (Schwichtenberg et al.,
2017) shows an approach that is agnostic to service
description formats but uses OpenAPI in the article.
The popularity of OpenAPI is also highlighted by its
use in other domains. For example (Willighagen and
Mélius, 2017) describes a case where OpenAPI 2.0 is
used in combination of other tools from the life scien-
ces community and points out that the specification
extension mechanism of OpenAPI 3.0 (that we use
Extending OpenAPI 3.0 to Build Web Services from their Specification
413