Skip to main content

A Model-Driven Method for Fast Building Consistent Web Services from OpenAPI-Compatible Models

  • Conference paper
  • First Online:
Model-Driven Engineering and Software Development (MODELSWARD 2018)

Abstract

Lots of software companies rely on web technologies to test market hypotheses in order to develop viable businesses. They often need to quickly build web services that are at the core of their Minimum Viable Products (MVPs). MVPs must be reliable whereas they are based on specifications and hypotheses that are likely to change. Web services need to be well documented, to make it easy to develop applications that consume them. Model Driven Engineering approaches have been proposed and used to develop and evolve web services on one hand, and document them on the other hand. However, these approaches lack the ability to be suitable for both (i) rapid prototyping, (ii) model verification, (iii) compatibility with common programming languages and (iv) alignment between documentation and implementation. Here we propose a meta-model to express web services, the related tool to verify models consistency and an integration of this approach into the OpenAPI Specification. We adopt a shallow verification process to allow rapid prototyping by developers who are not formal methods experts, while still offering design-time guarantees that improve product quality and development efficiency. Web services are defined using parametric components which enable to express and formally verify web service patterns and to safely reuse them in other contexts. We built a tool to check consistency of extended OpenAPI 3.0 models and associated components implementations in order to generate corresponding web services. This allows us to give flexibility and verification support to developers, even in the context of an incremental development, as illustrated by a case study.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Notes

  1. 1.

    https://www.startup-palace.com.

  2. 2.

    http://www.modelsward.org/?y=2018.

  3. 3.

    https://mustache.github.io/.

  4. 4.

    https://handlebarsjs.com/.

  5. 5.

    https://github.com/playframework/twirl.

  6. 6.

    The unstable version 3.0.0-rc0 does support OpenAPI 3.0 but is not yet finished and handle only a few languages and frameworks.

  7. 7.

    https://tools.ietf.org/html/rfc7231.

  8. 8.

    https://gitlab.startup-palace.com/research/swsg/blob/master/examples/registration/registration.model.

  9. 9.

    is equivalent to .

  10. 10.

    In the path.

  11. 11.

    Their paths are and .

  12. 12.

    In the x-swsg-ci property of the service.

  13. 13.

    In a x-swsg-name property.

  14. 14.

    The PHP class in Listing 6 depends on the Component interface and on the Ctx and Params classes. They are defined in code output by the code generator and are just implementation details of the SWSG specification in this specific code generator. Different code generators could require different constraints on implementations of atomic components.

  15. 15.

    https://gitlab.startup-palace.com/research/swsg/tree/master/examples/petstore.

References

  1. Open API Initiative: OpenAPI Specification (2017). https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.1.md

  2. RAML Workgroup: RAML (2016). https://raml.org/

  3. DeRemer, F., Kron, H.: Programming-in-the large versus programming-in-the-small. In: ACM SIGPLAN Notices, vol. 10, pp. 114–121. ACM (1975)

    Google Scholar 

  4. Bernardi, M.L., Cimitile, M., Di Lucca, G., Maria Maggi, F.: M3D: a tool for the model driven development of web applications. In: Proceedings of the Twelfth International Workshop on Web Information and Data Management, pp. 73–80 (2012)

    Google Scholar 

  5. Rocheteau, J., Sferruzza, D.: Reifier: Model-Driven Engineering of Component-Based and Service-Oriented JEE Applications (2016)

    Google Scholar 

  6. Scheidgen, M., Efftinge, S., Marticke, F.: Metamodeling vs metaprogramming: a case study on developing client libraries for REST APIs. In: Wąsowski, A., Lönn, H. (eds.) ECMFA 2016. LNCS, vol. 9764, pp. 205–216. Springer, Cham (2016). https://doi.org/10.1007/978-3-319-42061-5_13

    Chapter  Google Scholar 

  7. Sferruzza, D.: Safe Web Services Generator (2017). https://gitlab.startup-palace.com/research/swsg

  8. Sferruzza, D., Rocheteau, J., Attiogbé, C., Lanoix, A.: A Model-Driven Method for Fast Building Consistent Web Services in Practice (2018)

    Google Scholar 

  9. Bernardi, M.L., Cimitile, M., Maggi, F.M.: Automated development of constraint-driven web applications. In: Proceedings of the 31st Annual ACM Symposium on Applied Computing, pp. 1196–1203. ACM (2016)

    Google Scholar 

  10. Fu, X., Bultan, T., Su, J.: Analysis of interacting BPEL web services. In: Proceedings of the 13th International World Wide Web Conference. Citeseer (2004)

    Google Scholar 

  11. Gronmo, R., Skogan, D., Solheim, I., Oldevik, J.: Model-driven web services development. In: e-Technology, e-Commerce and e-Service, pp. 42–45. IEEE (2004)

    Google Scholar 

  12. van der Aalst, W.M.P., Pesic, M., Schonenberg, H.: Declarative workflows: balancing between flexibility and support. Comp. Sci. Res. Dev. 23, 99–113 (2009)

    Article  Google Scholar 

  13. Cao, H., Falleri, J.-R., Blanc, X.: Automated generation of REST API specification from plain HTML documentation. In: Maximilien, M., Vallecillo, A., Wang, J., Oriol, M. (eds.) ICSOC 2017. LNCS, vol. 10601, pp. 453–461. Springer, Cham (2017). https://doi.org/10.1007/978-3-319-69035-3_32

    Chapter  Google Scholar 

  14. Cremaschi, M., De Paoli, F.: Toward automatic semantic API descriptions to support services composition. In: De Paoli, F., Schulte, S., Broch Johnsen, E. (eds.) ESOCC 2017. LNCS, vol. 10465, pp. 159–167. Springer, Cham (2017). https://doi.org/10.1007/978-3-319-67262-5_12

    Chapter  Google Scholar 

  15. Tsouroplis, R., Petychakis, M., Alvertis, I., Biliri, E., Askounis, D.: Community-based API builder to manage APIs and their connections with Cloud-based Services. In: CAiSE Forum, pp. 17–23 (2015)

    Google Scholar 

  16. Schwichtenberg, S., Gerth, C., Engels, G.: From open API to semantic specifications and code adapters. In: 2017 IEEE International Conference on Web Services (ICWS), pp. 484–491. IEEE (2017)

    Google Scholar 

  17. Willighagen, E., Mélius, J.: Automatic OpenAPI to Bio.tools Conversion (2017)

    Google Scholar 

  18. Pugaczewski, J., Cummings, T., Hunter, D., Michalik, B.: Software engineering methodology for development of APIs for network management using the MEF LSO framework. IEEE Commun. Stand. Mag. 1(1), 92–96 (2017)

    Article  Google Scholar 

  19. SmartBear Software: Swagger Code Generator (2018). https://github.com/swagger-api/swagger-codegen/

  20. Wadler, P.: The essence of functional programming. In: Proceedings of the 19th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pp. 1–14. ACM (1992)

    Google Scholar 

  21. SmartBear Software: Swagger Editor (2018). https://github.com/swagger-api/swagger-editor

  22. SmartBear Software: Swagger UI (2018). https://github.com/swagger-api/swagger-UI

  23. Apiary: Dredd (2017). https://github.com/apiaryio/dredd

  24. van der Lee, M.: PHPSwaggerGen (2017). https://github.com/vanderlee/PHPSwaggerGen

  25. Open API Initiative: The Petstore Example (2017). https://github.com/OAI/OpenAPI-Specification/blob/3.0.1/examples/v3.0/petstore-expanded.yaml

  26. Lopes, P., Guardiani, F.: Slush-vertx (2017). https://github.com/pmlopes/slush-vertx

  27. Sferruzza, D.: Specification of SWSG extensions for OpenAPI (2018). https://gitlab.startup-palace.com/research/swsg/tree/master/openapi-extensions-specification/1.0.0.md

  28. Internet Engineering Task Force: JSON Schema: A Media Type for Describing JSON Documents (2016). https://tools.ietf.org/html/draft-wright-json-schema-00

  29. The PHP Group: PHP (2016). https://php.net/

  30. Otwel, T.: Laravel (2016). https://laravel.com/

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to David Sferruzza .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2019 Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Sferruzza, D., Rocheteau, J., Attiogbé, C., Lanoix, A. (2019). A Model-Driven Method for Fast Building Consistent Web Services from OpenAPI-Compatible Models. In: Hammoudi, S., Pires, L., Selic, B. (eds) Model-Driven Engineering and Software Development. MODELSWARD 2018. Communications in Computer and Information Science, vol 991. Springer, Cham. https://doi.org/10.1007/978-3-030-11030-7_2

Download citation

  • DOI: https://doi.org/10.1007/978-3-030-11030-7_2

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-030-11029-1

  • Online ISBN: 978-3-030-11030-7

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics