60 Implementation - HeinrichConvidera/RESTful-API-Gateway-Wiki GitHub Wiki

Implementation

Table of Contents

  1. OpenAPI
  2. GraphQL
  3. UML
  4. Plural <-> Singular

OpenAPI

The OpenAPI Specification was donated to the Linux Foundation under the OpenAPI Initiative in 2015. The specification creates a RESTful interface for easily developing and consuming an API by effectively mapping all the resources and operations associated with it.

OpenAPI Specification (formerly Swagger Specification) is an API description format for REST APIs. An OpenAPI file allows you to describe your entire API.

For more information about OpenAPI visit there homepage.

OpenAPI vs. RAML

Why do we use OpenAPI and not something similar like RAML?

Even if the basic description of RAML fits the project more than OpenAPI does, OpenAPI is more common and has a bigger community.

To see some commons and some differences look as this german article: OpenAPI vs. RAML (german article).

Tools

One of the biggest advantages of OpenAPI is the variety of free tools. Some tools for example converts RAML API specifications to OpenAPI specifications. Some of these tools are listed here.

OpenAPI also has a nice UI to design your API. The provided Online Editor or its source code on GitHub are public available.

The PHP basic support to read and write OpenAPI definitions / specifications is also free available.

Read and write OpenAPI yaml/json files and make the content accessible in PHP objects.

It's basicaly a json/yaml parser.

GraphQL

Some of the additional feature requests were to support GraphQL.

GraphQL is a query language for APIs and a runtime for fulfilling those queries with your existing data.

graphql-php is a feature-complete implementation of GraphQL specification in PHP (5.5+, 7.0+).

The documentation could be found here. The GitHub repository could be found here.

UML

Unified Modeling Language is a "specification defining a graphical language for visualizing, specifying, constructing, and documenting the artifacts of distributed object systems."

Tools

The tool used to visualize the application / the system is UMLet. Its GitHub repository could be found here. UMLet has also an Online Editor available.

PHP Traits

As Mojmír Němeček wrote in his answer about how to correctly visualize PHP Traits in UML class diagrams, traits will be handled like inheritances.

Logic packages

It seems natural to understand a package in class diagrams as its own namespace. However logic packages are packages which do not have its own namespace. To keep a visual difference between these package types we create a new package symbol for logic packages.

user login user login
Figure 60-1: Class Diagram: Package Figure 60-2: Class Diagram: Logic Package

Plural <-> Singular

To convert a word from singular to plural or vice versa we use a slightly modified version of the CakePHP Inflector.

⚠️ **GitHub.com Fallback** ⚠️