ETSI EG 203 647 V1.1.1 (2020-11)
Methods for Testing and Specification (MTS); Methodology for RESTful APIs specifications and testing
Methods for Testing and Specification (MTS); Methodology for RESTful APIs specifications and testing
DEG/MTS-203647
Metode za preskušanje in specificiranje (MTS) - Metodologija za specifikacije in preskušanje RESTful APIs
General Information
Buy Standard
Standards Content (Sample)
SLOVENSKI STANDARD
SIST EG 203 647 V1.1.1:2021
01-junij-2021
Metode za preskušanje in specificiranje (MTS) - Metodologija za specifikacije in
preskušanje RESTful APIs
Methods for Testing and Specification (MTS) - Methodology for RESTful APIs
specifications and testing
Ta slovenski standard je istoveten z: ETSI EG 203 647 V1.1.1 (2020-11)
ICS:
33.020 Telekomunikacije na splošno Telecommunications in
general
SIST EG 203 647 V1.1.1:2021 en
2003-01.Slovenski inštitut za standardizacijo. Razmnoževanje celote ali delov tega standarda ni dovoljeno.
---------------------- Page: 1 ----------------------
SIST EG 203 647 V1.1.1:2021
---------------------- Page: 2 ----------------------
SIST EG 203 647 V1.1.1:2021
ETSI EG 203 647 V1.1.1 (2020-11)
ETSI GUIDE
Methods for Testing and Specification (MTS);
Methodology for RESTful APIs specifications and testing
---------------------- Page: 3 ----------------------
SIST EG 203 647 V1.1.1:2021
2 ETSI EG 203 647 V1.1.1 (2020-11)
Reference
DEG/MTS-203647
Keywords
API, methodology, testing
ETSI
650 Route des Lucioles
F-06921 Sophia Antipolis Cedex - FRANCE
Tel.: +33 4 92 94 42 00 Fax: +33 4 93 65 47 16
Siret N° 348 623 562 00017 - NAF 742 C
Association à but non lucratif enregistrée à la
Sous-Préfecture de Grasse (06) N° 7803/88
Important notice
The present document can be downloaded from:
http://www.etsi.org/standards-search
The present document may be made available in electronic versions and/or in print. The content of any electronic and/or
print versions of the present document shall not be modified without the prior written authorization of ETSI. In case of any
existing or perceived difference in contents between such versions and/or in print, the prevailing version of an ETSI
deliverable is the one made publicly available in PDF format at www.etsi.org/deliver.
Users of the present document should be aware that the document may be subject to revision or change of status.
Information on the current status of this and other ETSI documents is available at
https://portal.etsi.org/TB/ETSIDeliverableStatus.aspx
If you find errors in the present document, please send your comment to one of the following services:
https://portal.etsi.org/People/CommiteeSupportStaff.aspx
Copyright Notification
No part may be reproduced or utilized in any form or by any means, electronic or mechanical, including photocopying
and microfilm except as authorized by written permission of ETSI.
The content of the PDF version shall not be modified without the written authorization of ETSI.
The copyright and the foregoing restriction extend to reproduction in all media.
© ETSI 2020.
All rights reserved.
DECT™, PLUGTESTS™, UMTS™ and the ETSI logo are trademarks of ETSI registered for the benefit of its Members.
3GPP™ and LTE™ are trademarks of ETSI registered for the benefit of its Members and
of the 3GPP Organizational Partners.
oneM2M™ logo is a trademark of ETSI registered for the benefit of its Members and
of the oneM2M Partners.
®
GSM and the GSM logo are trademarks registered and owned by the GSM Association.
ETSI
---------------------- Page: 4 ----------------------
SIST EG 203 647 V1.1.1:2021
3 ETSI EG 203 647 V1.1.1 (2020-11)
Contents
Intellectual Property Rights . 5
Foreword . 5
Modal verbs terminology . 5
Executive Summary . 5
Introduction . 5
1 Scope . 7
2 References . 7
2.1 Normative references . 7
2.2 Informative references . 7
3 Definition of terms, symbols and abbreviations . 10
3.1 Terms . 10
3.2 Symbols . 11
3.3 Abbreviations . 11
4 Specification methodologies for RESTful APIs. 12
4.1 RESTful APIs specification in a staged standardization approach . 12
4.2 Introduction on RESTful interfaces . 13
4.2.1 Introduction. 13
4.2.2 Main Principles of the RESTful paradigm . 13
4.2.3 HTTP Methods and their Usage . 14
4.2.3.1 Overview . 14
4.2.3.2 POST . 14
4.2.3.3 GET . 14
4.2.3.4 PUT/PATCH . 14
4.2.3.5 DELETE . 15
4.2.4 Error Reporting . 15
4.2.4.1 Overview . 15
4.2.4.2 Client Errors . 16
4.2.4.3 Server Errors . 16
4.3 API specification process . 17
4.3.1 RESTful interface description languages . 17
4.3.2 Standardizing RESTful interfaces using OpenAPI . 17
4.3.2.1 OpenAPI Overview . 17
4.3.2.2 Document . 18
4.3.2.3 Data types . 18
4.3.2.4 Operations . 19
4.3.2.5 Requests . 20
4.3.2.6 Responses . 21
4.3.2.7 Callbacks . 22
4.3.2.8 Query parameters . 23
4.3.2.9 Extensions . 23
4.3.2.10 Other . 24
4.3.2.11 Process . 25
4.4 Common Patterns . 26
4.4.1 Filtering Patterns . 26
4.4.1.1 Overview . 26
4.4.1.2 Attribute-based filtering for collections . 26
4.4.1.3 Attribute Selector . 27
4.4.1.4 Pagination. 28
4.4.2 Pattern for URI Creation . 28
4.4.2.1 Resource URI Structure . 28
4.4.2.2 Design Rules for REST API URI . 29
4.4.3 Pattern to avoid Update Conflict and Data loss . 29
4.4.3.1 Description . 29
ETSI
---------------------- Page: 5 ----------------------
SIST EG 203 647 V1.1.1:2021
4 ETSI EG 203 647 V1.1.1 (2020-11)
4.4.4 Authorization and Authentication . 30
4.4.4.1 Overview . 30
4.4.4.2 API Authorization using OAuth 2.0 Access tokens . 31
4.4.4.3 API Authorization using TLS Certificates . 31
4.4.4.4 API Authorization using OpenID connect with JWT ID Token . 32
4.4.5 Non-CRUD operations . 33
4.4.5.1 Description . 33
4.5 Naming conventions . 34
4.6 Versioning . 36
4.6.1 Specifications and OpenAPI definitions versions . 36
4.6.2 Modelling version information . 37
4.7 Implementation . 37
5 Testing methodology for REST APIs . 38
5.1 Overview . 38
5.2 Testing Frameworks and Methodologies . 38
5.3 Conformance and Interoperability Testing . 39
5.3.1 General . 39
5.3.2 RESTful API-specific . 40
5.3.3 Domain-specific . 40
5.4 Test Specification Development . 40
5.4.1 General . 40
5.4.2 RESTful API-specific . 42
5.4.3 Domain-specific . 52
5.5 Test Deployment and Execution . 52
5.6 Test Maintenance and Evolution . 53
6 Tooling recommendations . 53
6.1 Introduction . 53
6.2 Design and drafting . 53
6.2.1 Overview . 53
6.2.2 Recommendations on editing tool selection . 54
6.3 Coordination and collaboration . 54
6.4 Validation and quality check . 54
6.5 Post processing . 55
7 Working Examples . 56
8 Survey of Activities at ETSI and Beyond . 56
8.1 Review of base documents . 56
8.1.1 ETSI GS MEC 009 (V2.1.1) . 56
8.1.2 ETSI GR MEC-DEC 025 (V2.1.1) . 57
8.1.3 Draft ETSI GS MEC-DEC 032-1 (V0.0.3) . 57
8.1.4 ETSI GS CIM 009 (V1.2.1) . 57
8.1.5 ETSI GS QKD 014 (V1.1.1) . 57
8.1.6 ETSI TS 129 501 (V15.3.0) . 57
8.1.7 ETSI GS NFV-SOL 013 (V2.7.1) . 58
8.1.8 ETSI GS NFV-SOL 015 (V1.1.1) . 58
8.1.9 ETSI GS NFV-TST 010 (V2.4.1) . 58
8.1.10 ETSI TS 118 115 (V2.0.0) . 58
8.1.11 oneM2M TS-0018 (V3.2.0) . 59
8.1.12 TM Forum Open APIs initiative . 59
8.1.13 OMG hData RESTful Transport . 59
8.1.14 OASIS OData v4.01 . 59
8.2 API adoption survey . 60
Annex A (informative): Bibliography . 62
Annex B (informative): Change History . 63
History . 64
ETSI
---------------------- Page: 6 ----------------------
SIST EG 203 647 V1.1.1:2021
5 ETSI EG 203 647 V1.1.1 (2020-11)
Intellectual Property Rights
Essential patents
IPRs essential or potentially essential to normative deliverables may have been declared to ETSI. The information
pertaining to these essential IPRs, if any, is publicly available for ETSI members and non-members, and can be found
in ETSI SR 000 314: "Intellectual Property Rights (IPRs); Essential, or potentially Essential, IPRs notified to ETSI in
respect of ETSI standards", which is available from the ETSI Secretariat. Latest updates are available on the ETSI Web
server (https://ipr.etsi.org/).
Pursuant to the ETSI IPR Policy, no investigation, including IPR searches, has been carried out by ETSI. No guarantee
can be given as to the existence of other IPRs not referenced in ETSI SR 000 314 (or the updates on the ETSI Web
server) which are, or may be, or may become, essential to the present document.
Trademarks
The present document may include trademarks and/or tradenames which are asserted and/or registered by their owners.
ETSI claims no ownership of these except for any which are indicated as being the property of ETSI, and conveys no
right to use or reproduce any trademark and/or tradename. Mention of those trademarks in the present document does
not constitute an endorsement by ETSI of products, services or organizations associated with those trademarks.
Foreword
This ETSI Guide (EG) has been produced by ETSI Technical Committee Methods for Testing and Specification (MTS).
Modal verbs terminology
In the present document "should", "should not", "may", "need not", "will", "will not", "can" and "cannot" are to be
interpreted as described in clause 3.2 of the ETSI Drafting Rules (Verbal forms for the expression of provisions).
"must" and "must not" are NOT allowed in ETSI deliverables except when used in direct citation.
Executive Summary
The present document offers a report of standardization activities for telecommunication interfaces and application
programming interfaces based on the REpresentational State Transfer paradigm (RESTful APIs).
The guide collects conventions, methodology and design patterns from ETSI groups and from the industry and proposes
consolidated guidelines to serve the complete lifecycle of standardization, from design to validation.
Introduction
More and more telecommunication and digital interfaces are being implemented as software-based solutions.
A well-known and largely adopted design methodology is taking place across several standardization activities: using
the REpresentational State Transfer (REST) paradigm and resource-oriented protocols (e.g. HTTP(S), CoAP) or other
possibly applicable protocols (MQTT, AMQP).
This phenomenon is becoming common practice in ETSI Technical Bodies (TBs) and Industry Specification Groups
(ISGs) as well as in ETSI's Partnership Projects standardization activities, across several technologies, often quite
different in scope and user community.
As adoption of standardizing RESTful APIs rises, it is becoming clear that specification of "RESTful APIs" needs to be:
• Fast, as the interfaces are simpler than other approaches and tend to have a shorter lifespan.
ETSI
---------------------- Page: 7 ----------------------
SIST EG 203 647 V1.1.1:2021
6 ETSI EG 203 647 V1.1.1 (2020-11)
• Automatable, given the high number of conventions in the design of an API, parts of the specification,
implementation and testing process are well suited to be automated.
• Developer friendly, since developers need support in the discovery and implementation of the interfaces by
using tools and methodologies more closely aligned with software development.
In this regard, the present Guide for RESTful API specification and testing intends to support:
• Consolidation of efforts among different standardization groups and activities, who would be able to leverage
from others' experience.
• Delivery time of specifications to be spent on the design of the application level features, more than re-
assessing the principles and details at a transport protocol level.
• Standards quality to meet the excellence expected in the whole lifecycle of standardization, such as design,
specification, testability and interoperability validation.
Several TBs and ISGs have already specified RESTful APIs and documented their conventions and processes in group
specific guidelines. Further initiatives will be carried out during the upcoming years by the same groups as well as new
ones, therefore it is strategic to align and consolidate the standardization efforts among ETSI membership.
The present document is structured as follows:
• clause 4 introduces the main concepts and terminology for the RESTful approach, then presents
recommendations for RESTful API specifications development, with the introduction of a code-first approach
and discussion of the foreseen benefits of its application;
• clause 5 presents recommendation and methodology for development of test specifications for RESTful APIs;
• clause 6 collects best practices and references to the available tools to manipulate and present the code needed
artefacts;
• clause 7 contains a collection of examples on the expected outcomes of the different parts of the presented
methodology;
• clause 8 reports on the outcomes from the analysis of the base documents - from ETSI groups or from other
organizations - for the preparation of the present work and the results of a survey conducted among ETSI
delegates on REST APIs adoption.
ETSI
---------------------- Page: 8 ----------------------
SIST EG 203 647 V1.1.1:2021
7 ETSI EG 203 647 V1.1.1 (2020-11)
1 Scope
The scope of the present document is to present a methodology for specification and testing of RESTful APIs,
i.e. telecommunication interfaces based on the Representational State Transfer paradigm, suitable for application in the
standardization context.
In particular, the present guide is meant to serve ETSI membership and groups in the effort to unify and consolidate the
approaches and practices in current and future standardization activities at ETSI and its Partnership Projects.
The Guide collects the best practices from standardization, industry and research in order to provide a modern and
future-proofed approach to the subject.
The intended audience is primarily standardization groups at ETSI, but the guide may also serve as reference for users
and vendors in industry, with a special focus in Open Source communities.
The Guide recommendations on conventions, methodologies, design-patterns and architectural choices to be used in
standardization of RESTful APIs, specification and execution of standardized conformance and interoperability test
suites.
2 References
2.1 Normative references
Normative references are not applicable in the present document.
2.2 Informative references
References are either specific (identified by date of publication and/or edition number or version number) or
non-specific. For specific references, only the cited version applies. For non-specific references, the latest version of the
referenced document (including any amendments) applies.
NOTE: While any hyperlinks included in this clause were valid at the time of publication, ETSI cannot guarantee
their long-term validity.
The following referenced documents are not necessary for the application of the present document, but they assist the
user with regard to a particular subject area.
[i.1] "A Guide to Writing World Class Standards".
NOTE: Available at
https://portal.etsi.org/Portals/0/TBpages/edithelp/Docs/AGuideToWritingWorldClassStandards.pdf?ver=
2014-05-19-124137-453.
[i.2] Recommendation ITU-T I.130: "Method for the characterization of telecommunication services
supported by an ISDN and network capabilities of an ISDN".
[i.3] IETF RFC 5023: "The Atom Publishing Protocol".
[i.4] ETSI EG 203 130: "Methods for Testing and Specification (MTS); Model-Based Testing (MBT);
Methodology for standardized test specification development".
[i.5] IETF RFC 7231: "Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content".
[i.6] IETF RFC 8259: "The JavaScript Object Notation (JSON) Data Interchange Format".
[i.7] "The State of API 2019 survey", SmartBear.
[i.8] ETSI EG 201 015: "Methods for Testing and Specification (MTS); Standards engineering process;
A Handbook of validation methods".
ETSI
---------------------- Page: 9 ----------------------
SIST EG 203 647 V1.1.1:2021
8 ETSI EG 203 647 V1.1.1 (2020-11)
[i.9] ETSI EG 201 058 (V1.2.4): "Methods for Testing and Specification (MTS); Implementation
Conformance Statement (ICS); proforma style guide".
[i.10] Repository of attachments for ETSI EG 203 647 on ETSI Forge.
NOTE: Available at https://forge.etsi.org/rep/mts/eg-203647-restful-api-guide.
[i.11] ETSI Forge Platform.
NOTE: Available at https://forge.etsi.org.
[i.12] ETSI Labs Platform.
NOTE: Available at https://labs.etsi.org.
[i.13] TDL Open Source Project.
NOTE: Available at https://top.etsi.org.
[i.14] "YAML Ain't Markup Language (YAML™) Version 1.2" specification.
NOTE: Available at https://yaml.org/spec/1.2/spec.html.
[i.15] OpenAPI™ specification, Version 3.0.3.
NOTE: Available at https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.3.md.
[i.16] JSON Schema definition.
NOTE: Available at https://json-schema.org/.
[i.17] IETF RFC 3986: "Uniform
...
ETSI EG 203 647 V1.1.1 (2020-11)
ETSI GUIDE
Methods for Testing and Specification (MTS);
Methodology for RESTful APIs specifications and testing
---------------------- Page: 1 ----------------------
2 ETSI EG 203 647 V1.1.1 (2020-11)
Reference
DEG/MTS-203647
Keywords
API, methodology, testing
ETSI
650 Route des Lucioles
F-06921 Sophia Antipolis Cedex - FRANCE
Tel.: +33 4 92 94 42 00 Fax: +33 4 93 65 47 16
Siret N° 348 623 562 00017 - NAF 742 C
Association à but non lucratif enregistrée à la
Sous-Préfecture de Grasse (06) N° 7803/88
Important notice
The present document can be downloaded from:
http://www.etsi.org/standards-search
The present document may be made available in electronic versions and/or in print. The content of any electronic and/or
print versions of the present document shall not be modified without the prior written authorization of ETSI. In case of any
existing or perceived difference in contents between such versions and/or in print, the prevailing version of an ETSI
deliverable is the one made publicly available in PDF format at www.etsi.org/deliver.
Users of the present document should be aware that the document may be subject to revision or change of status.
Information on the current status of this and other ETSI documents is available at
https://portal.etsi.org/TB/ETSIDeliverableStatus.aspx
If you find errors in the present document, please send your comment to one of the following services:
https://portal.etsi.org/People/CommiteeSupportStaff.aspx
Copyright Notification
No part may be reproduced or utilized in any form or by any means, electronic or mechanical, including photocopying
and microfilm except as authorized by written permission of ETSI.
The content of the PDF version shall not be modified without the written authorization of ETSI.
The copyright and the foregoing restriction extend to reproduction in all media.
© ETSI 2020.
All rights reserved.
DECT™, PLUGTESTS™, UMTS™ and the ETSI logo are trademarks of ETSI registered for the benefit of its Members.
3GPP™ and LTE™ are trademarks of ETSI registered for the benefit of its Members and
of the 3GPP Organizational Partners.
oneM2M™ logo is a trademark of ETSI registered for the benefit of its Members and
of the oneM2M Partners.
®
GSM and the GSM logo are trademarks registered and owned by the GSM Association.
ETSI
---------------------- Page: 2 ----------------------
3 ETSI EG 203 647 V1.1.1 (2020-11)
Contents
Intellectual Property Rights . 5
Foreword . 5
Modal verbs terminology . 5
Executive Summary . 5
Introduction . 5
1 Scope . 7
2 References . 7
2.1 Normative references . 7
2.2 Informative references . 7
3 Definition of terms, symbols and abbreviations . 10
3.1 Terms . 10
3.2 Symbols . 11
3.3 Abbreviations . 11
4 Specification methodologies for RESTful APIs. 12
4.1 RESTful APIs specification in a staged standardization approach . 12
4.2 Introduction on RESTful interfaces . 13
4.2.1 Introduction. 13
4.2.2 Main Principles of the RESTful paradigm . 13
4.2.3 HTTP Methods and their Usage . 14
4.2.3.1 Overview . 14
4.2.3.2 POST . 14
4.2.3.3 GET . 14
4.2.3.4 PUT/PATCH . 14
4.2.3.5 DELETE . 15
4.2.4 Error Reporting . 15
4.2.4.1 Overview . 15
4.2.4.2 Client Errors . 16
4.2.4.3 Server Errors . 16
4.3 API specification process . 17
4.3.1 RESTful interface description languages . 17
4.3.2 Standardizing RESTful interfaces using OpenAPI . 17
4.3.2.1 OpenAPI Overview . 17
4.3.2.2 Document . 18
4.3.2.3 Data types . 18
4.3.2.4 Operations . 19
4.3.2.5 Requests . 20
4.3.2.6 Responses . 21
4.3.2.7 Callbacks . 22
4.3.2.8 Query parameters . 23
4.3.2.9 Extensions . 23
4.3.2.10 Other . 24
4.3.2.11 Process . 25
4.4 Common Patterns . 26
4.4.1 Filtering Patterns . 26
4.4.1.1 Overview . 26
4.4.1.2 Attribute-based filtering for collections . 26
4.4.1.3 Attribute Selector . 27
4.4.1.4 Pagination. 28
4.4.2 Pattern for URI Creation . 28
4.4.2.1 Resource URI Structure . 28
4.4.2.2 Design Rules for REST API URI . 29
4.4.3 Pattern to avoid Update Conflict and Data loss . 29
4.4.3.1 Description . 29
ETSI
---------------------- Page: 3 ----------------------
4 ETSI EG 203 647 V1.1.1 (2020-11)
4.4.4 Authorization and Authentication . 30
4.4.4.1 Overview . 30
4.4.4.2 API Authorization using OAuth 2.0 Access tokens . 31
4.4.4.3 API Authorization using TLS Certificates . 31
4.4.4.4 API Authorization using OpenID connect with JWT ID Token . 32
4.4.5 Non-CRUD operations . 33
4.4.5.1 Description . 33
4.5 Naming conventions . 34
4.6 Versioning . 36
4.6.1 Specifications and OpenAPI definitions versions . 36
4.6.2 Modelling version information . 37
4.7 Implementation . 37
5 Testing methodology for REST APIs . 38
5.1 Overview . 38
5.2 Testing Frameworks and Methodologies . 38
5.3 Conformance and Interoperability Testing . 39
5.3.1 General . 39
5.3.2 RESTful API-specific . 40
5.3.3 Domain-specific . 40
5.4 Test Specification Development . 40
5.4.1 General . 40
5.4.2 RESTful API-specific . 42
5.4.3 Domain-specific . 52
5.5 Test Deployment and Execution . 52
5.6 Test Maintenance and Evolution . 53
6 Tooling recommendations . 53
6.1 Introduction . 53
6.2 Design and drafting . 53
6.2.1 Overview . 53
6.2.2 Recommendations on editing tool selection . 54
6.3 Coordination and collaboration . 54
6.4 Validation and quality check . 54
6.5 Post processing . 55
7 Working Examples . 56
8 Survey of Activities at ETSI and Beyond . 56
8.1 Review of base documents . 56
8.1.1 ETSI GS MEC 009 (V2.1.1) . 56
8.1.2 ETSI GR MEC-DEC 025 (V2.1.1) . 57
8.1.3 Draft ETSI GS MEC-DEC 032-1 (V0.0.3) . 57
8.1.4 ETSI GS CIM 009 (V1.2.1) . 57
8.1.5 ETSI GS QKD 014 (V1.1.1) . 57
8.1.6 ETSI TS 129 501 (V15.3.0) . 57
8.1.7 ETSI GS NFV-SOL 013 (V2.7.1) . 58
8.1.8 ETSI GS NFV-SOL 015 (V1.1.1) . 58
8.1.9 ETSI GS NFV-TST 010 (V2.4.1) . 58
8.1.10 ETSI TS 118 115 (V2.0.0) . 58
8.1.11 oneM2M TS-0018 (V3.2.0) . 59
8.1.12 TM Forum Open APIs initiative . 59
8.1.13 OMG hData RESTful Transport . 59
8.1.14 OASIS OData v4.01 . 59
8.2 API adoption survey . 60
Annex A (informative): Bibliography . 62
Annex B (informative): Change History . 63
History . 64
ETSI
---------------------- Page: 4 ----------------------
5 ETSI EG 203 647 V1.1.1 (2020-11)
Intellectual Property Rights
Essential patents
IPRs essential or potentially essential to normative deliverables may have been declared to ETSI. The information
pertaining to these essential IPRs, if any, is publicly available for ETSI members and non-members, and can be found
in ETSI SR 000 314: "Intellectual Property Rights (IPRs); Essential, or potentially Essential, IPRs notified to ETSI in
respect of ETSI standards", which is available from the ETSI Secretariat. Latest updates are available on the ETSI Web
server (https://ipr.etsi.org/).
Pursuant to the ETSI IPR Policy, no investigation, including IPR searches, has been carried out by ETSI. No guarantee
can be given as to the existence of other IPRs not referenced in ETSI SR 000 314 (or the updates on the ETSI Web
server) which are, or may be, or may become, essential to the present document.
Trademarks
The present document may include trademarks and/or tradenames which are asserted and/or registered by their owners.
ETSI claims no ownership of these except for any which are indicated as being the property of ETSI, and conveys no
right to use or reproduce any trademark and/or tradename. Mention of those trademarks in the present document does
not constitute an endorsement by ETSI of products, services or organizations associated with those trademarks.
Foreword
This ETSI Guide (EG) has been produced by ETSI Technical Committee Methods for Testing and Specification (MTS).
Modal verbs terminology
In the present document "should", "should not", "may", "need not", "will", "will not", "can" and "cannot" are to be
interpreted as described in clause 3.2 of the ETSI Drafting Rules (Verbal forms for the expression of provisions).
"must" and "must not" are NOT allowed in ETSI deliverables except when used in direct citation.
Executive Summary
The present document offers a report of standardization activities for telecommunication interfaces and application
programming interfaces based on the REpresentational State Transfer paradigm (RESTful APIs).
The guide collects conventions, methodology and design patterns from ETSI groups and from the industry and proposes
consolidated guidelines to serve the complete lifecycle of standardization, from design to validation.
Introduction
More and more telecommunication and digital interfaces are being implemented as software-based solutions.
A well-known and largely adopted design methodology is taking place across several standardization activities: using
the REpresentational State Transfer (REST) paradigm and resource-oriented protocols (e.g. HTTP(S), CoAP) or other
possibly applicable protocols (MQTT, AMQP).
This phenomenon is becoming common practice in ETSI Technical Bodies (TBs) and Industry Specification Groups
(ISGs) as well as in ETSI's Partnership Projects standardization activities, across several technologies, often quite
different in scope and user community.
As adoption of standardizing RESTful APIs rises, it is becoming clear that specification of "RESTful APIs" needs to be:
• Fast, as the interfaces are simpler than other approaches and tend to have a shorter lifespan.
ETSI
---------------------- Page: 5 ----------------------
6 ETSI EG 203 647 V1.1.1 (2020-11)
• Automatable, given the high number of conventions in the design of an API, parts of the specification,
implementation and testing process are well suited to be automated.
• Developer friendly, since developers need support in the discovery and implementation of the interfaces by
using tools and methodologies more closely aligned with software development.
In this regard, the present Guide for RESTful API specification and testing intends to support:
• Consolidation of efforts among different standardization groups and activities, who would be able to leverage
from others' experience.
• Delivery time of specifications to be spent on the design of the application level features, more than re-
assessing the principles and details at a transport protocol level.
• Standards quality to meet the excellence expected in the whole lifecycle of standardization, such as design,
specification, testability and interoperability validation.
Several TBs and ISGs have already specified RESTful APIs and documented their conventions and processes in group
specific guidelines. Further initiatives will be carried out during the upcoming years by the same groups as well as new
ones, therefore it is strategic to align and consolidate the standardization efforts among ETSI membership.
The present document is structured as follows:
• clause 4 introduces the main concepts and terminology for the RESTful approach, then presents
recommendations for RESTful API specifications development, with the introduction of a code-first approach
and discussion of the foreseen benefits of its application;
• clause 5 presents recommendation and methodology for development of test specifications for RESTful APIs;
• clause 6 collects best practices and references to the available tools to manipulate and present the code needed
artefacts;
• clause 7 contains a collection of examples on the expected outcomes of the different parts of the presented
methodology;
• clause 8 reports on the outcomes from the analysis of the base documents - from ETSI groups or from other
organizations - for the preparation of the present work and the results of a survey conducted among ETSI
delegates on REST APIs adoption.
ETSI
---------------------- Page: 6 ----------------------
7 ETSI EG 203 647 V1.1.1 (2020-11)
1 Scope
The scope of the present document is to present a methodology for specification and testing of RESTful APIs,
i.e. telecommunication interfaces based on the Representational State Transfer paradigm, suitable for application in the
standardization context.
In particular, the present guide is meant to serve ETSI membership and groups in the effort to unify and consolidate the
approaches and practices in current and future standardization activities at ETSI and its Partnership Projects.
The Guide collects the best practices from standardization, industry and research in order to provide a modern and
future-proofed approach to the subject.
The intended audience is primarily standardization groups at ETSI, but the guide may also serve as reference for users
and vendors in industry, with a special focus in Open Source communities.
The Guide recommendations on conventions, methodologies, design-patterns and architectural choices to be used in
standardization of RESTful APIs, specification and execution of standardized conformance and interoperability test
suites.
2 References
2.1 Normative references
Normative references are not applicable in the present document.
2.2 Informative references
References are either specific (identified by date of publication and/or edition number or version number) or
non-specific. For specific references, only the cited version applies. For non-specific references, the latest version of the
referenced document (including any amendments) applies.
NOTE: While any hyperlinks included in this clause were valid at the time of publication, ETSI cannot guarantee
their long-term validity.
The following referenced documents are not necessary for the application of the present document, but they assist the
user with regard to a particular subject area.
[i.1] "A Guide to Writing World Class Standards".
NOTE: Available at
https://portal.etsi.org/Portals/0/TBpages/edithelp/Docs/AGuideToWritingWorldClassStandards.pdf?ver=
2014-05-19-124137-453.
[i.2] Recommendation ITU-T I.130: "Method for the characterization of telecommunication services
supported by an ISDN and network capabilities of an ISDN".
[i.3] IETF RFC 5023: "The Atom Publishing Protocol".
[i.4] ETSI EG 203 130: "Methods for Testing and Specification (MTS); Model-Based Testing (MBT);
Methodology for standardized test specification development".
[i.5] IETF RFC 7231: "Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content".
[i.6] IETF RFC 8259: "The JavaScript Object Notation (JSON) Data Interchange Format".
[i.7] "The State of API 2019 survey", SmartBear.
[i.8] ETSI EG 201 015: "Methods for Testing and Specification (MTS); Standards engineering process;
A Handbook of validation methods".
ETSI
---------------------- Page: 7 ----------------------
8 ETSI EG 203 647 V1.1.1 (2020-11)
[i.9] ETSI EG 201 058 (V1.2.4): "Methods for Testing and Specification (MTS); Implementation
Conformance Statement (ICS); proforma style guide".
[i.10] Repository of attachments for ETSI EG 203 647 on ETSI Forge.
NOTE: Available at https://forge.etsi.org/rep/mts/eg-203647-restful-api-guide.
[i.11] ETSI Forge Platform.
NOTE: Available at https://forge.etsi.org.
[i.12] ETSI Labs Platform.
NOTE: Available at https://labs.etsi.org.
[i.13] TDL Open Source Project.
NOTE: Available at https://top.etsi.org.
[i.14] "YAML Ain't Markup Language (YAML™) Version 1.2" specification.
NOTE: Available at https://yaml.org/spec/1.2/spec.html.
[i.15] OpenAPI™ specification, Version 3.0.3.
NOTE: Available at https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.3.md.
[i.16] JSON Schema definition.
NOTE: Available at https://json-schema.org/.
[i.17] IETF RFC 3986: "Uniform Resource Identifier (URI): Generic Syntax".
NOTE: Available at https://tools.ietf.org/html/rfc3986.
[i.18] IETF RFC 2388: "Returning Values from Forms: multipart/form-data".
NOTE: Available at https://tools.ietf.org/html/rfc2388.
[i.19] IETF RFC 1738: "Uniform Resource Locators (URL)".
NOTE: Available at https://tools.ietf.org/html/rfc1738.
[i.20] ETSI Drafting Rules.
NOTE: Available at https://portal.etsi.org/Services/editHelp/How-to-start/ETSI-Drafting-Rules.
[i.21] ETSI TS 129 501 (V15.3.0): "5G; 5G System; Principles and Guidelines for Services Definition;
Stage 3 (3GPP TS 29.501 version 15.3.0 Release 15)".
[i.22] ETSI GS NFV-SOL 015 (V1.1.1): "Network Functions Virtualisation (NFV); Protocols and Data
Models; Specification of Patterns and Conventions for RESTful NFV-MANO APIs".
[i.23] ETSI GS MEC 009 (V2.1.1): "Multi-access Edge Computing (MEC); General principles for MEC
Service APIs".
[i.24] ETSI GR
...
Final draft ETSI EG 203 647 V1.1.1 (2020-09)
ETSI GUIDE
Methods for Testing and Specification (MTS);
Methodology for RESTful APIs specifications and testing
---------------------- Page: 1 ----------------------
2 Final draft ETSI EG 203 647 V1.1.1 (2020-09)
Reference
DEG/MTS-203647
Keywords
API, methodology, testing
ETSI
650 Route des Lucioles
F-06921 Sophia Antipolis Cedex - FRANCE
Tel.: +33 4 92 94 42 00 Fax: +33 4 93 65 47 16
Siret N° 348 623 562 00017 - NAF 742 C
Association à but non lucratif enregistrée à la
Sous-Préfecture de Grasse (06) N° 7803/88
Important notice
The present document can be downloaded from:
http://www.etsi.org/standards-search
The present document may be made available in electronic versions and/or in print. The content of any electronic and/or
print versions of the present document shall not be modified without the prior written authorization of ETSI. In case of any
existing or perceived difference in contents between such versions and/or in print, the prevailing version of an ETSI
deliverable is the one made publicly available in PDF format at www.etsi.org/deliver.
Users of the present document should be aware that the document may be subject to revision or change of status.
Information on the current status of this and other ETSI documents is available at
https://portal.etsi.org/TB/ETSIDeliverableStatus.aspx
If you find errors in the present document, please send your comment to one of the following services:
https://portal.etsi.org/People/CommiteeSupportStaff.aspx
Copyright Notification
No part may be reproduced or utilized in any form or by any means, electronic or mechanical, including photocopying
and microfilm except as authorized by written permission of ETSI.
The content of the PDF version shall not be modified without the written authorization of ETSI.
The copyright and the foregoing restriction extend to reproduction in all media.
© ETSI 2020.
All rights reserved.
DECT™, PLUGTESTS™, UMTS™ and the ETSI logo are trademarks of ETSI registered for the benefit of its Members.
3GPP™ and LTE™ are trademarks of ETSI registered for the benefit of its Members and
of the 3GPP Organizational Partners.
oneM2M™ logo is a trademark of ETSI registered for the benefit of its Members and
of the oneM2M Partners.
®
GSM and the GSM logo are trademarks registered and owned by the GSM Association.
ETSI
---------------------- Page: 2 ----------------------
3 Final draft ETSI EG 203 647 V1.1.1 (2020-09)
Contents
Intellectual Property Rights . 5
Foreword . 5
Modal verbs terminology . 5
Executive Summary . 5
Introduction . 5
1 Scope . 7
2 References . 7
2.1 Normative references . 7
2.2 Informative references . 7
3 Definition of terms, symbols and abbreviations . 10
3.1 Terms . 10
3.2 Symbols . 11
3.3 Abbreviations . 11
4 Specification methodologies for RESTful APIs. 12
4.1 RESTful APIs specification in a staged standardization approach . 12
4.2 Introduction on RESTful interfaces . 13
4.2.1 Introduction. 13
4.2.2 Main Principles of the RESTful paradigm . 13
4.2.3 HTTP Methods and their Usage . 14
4.2.3.1 Overview . 14
4.2.3.2 POST . 14
4.2.3.3 GET . 14
4.2.3.4 PUT/PATCH . 14
4.2.3.5 DELETE . 15
4.2.4 Error Reporting . 15
4.2.4.1 Overview . 15
4.2.4.2 Client Errors . 16
4.2.4.3 Server Errors . 16
4.3 API specification process . 17
4.3.1 RESTful interface description languages . 17
4.3.2 Standardizing RESTful interfaces using OpenAPI . 17
4.3.2.1 OpenAPI Overview . 17
4.3.2.2 Document . 18
4.3.2.3 Data types . 18
4.3.2.4 Operations . 19
4.3.2.5 Requests . 20
4.3.2.6 Responses . 21
4.3.2.7 Callbacks . 22
4.3.2.8 Query parameters . 23
4.3.2.9 Extensions . 23
4.3.2.10 Other . 24
4.3.2.11 Process . 25
4.4 Common Patterns . 26
4.4.1 Filtering Patterns . 26
4.4.1.1 Overview . 26
4.4.1.2 Attribute-based filtering for collections . 26
4.4.1.3 Attribute Selector . 27
4.4.1.4 Pagination. 28
4.4.2 Pattern for URI Creation . 28
4.4.2.1 Resource URI Structure . 28
4.4.2.2 Design Rules for REST API URI . 29
4.4.3 Pattern to avoid Update Conflict and Data loss . 29
4.4.3.1 Description . 29
ETSI
---------------------- Page: 3 ----------------------
4 Final draft ETSI EG 203 647 V1.1.1 (2020-09)
4.4.4 Authorization and Authentication . 30
4.4.4.1 Overview . 30
4.4.4.2 API Authorization using OAuth 2.0 Access tokens . 31
4.4.4.3 API Authorization using TLS Certificates . 31
4.4.4.4 API Authorization using OpenID connect with JWT ID Token . 32
4.4.5 Non-CRUD operations . 33
4.4.5.1 Description . 33
4.5 Naming conventions . 34
4.6 Versioning . 36
4.6.1 Specifications and OpenAPI definitions versions . 36
4.6.2 Modelling version information . 37
4.7 Implementation . 37
5 Testing methodology for REST APIs . 38
5.1 Overview . 38
5.2 Testing Frameworks and Methodologies . 38
5.3 Conformance and Interoperability Testing . 39
5.3.1 General . 39
5.3.2 RESTful API-specific . 40
5.3.3 Domain-specific . 40
5.4 Test Specification Development . 40
5.4.1 General . 40
5.4.2 RESTful API-specific . 42
5.4.3 Domain-specific . 52
5.5 Test Deployment and Execution . 52
5.6 Test Maintenance and Evolution . 53
6 Tooling recommendations . 53
6.1 Introduction . 53
6.2 Design and drafting . 53
6.2.1 Overview . 53
6.2.2 Recommendations on editing tool selection . 54
6.3 Coordination and collaboration . 54
6.4 Validation and quality check . 54
6.5 Post processing . 55
7 Working Examples . 56
8 Survey of Activities at ETSI and Beyond . 56
8.1 Review of base documents . 56
8.1.1 ETSI GS MEC 009 (V2.1.1) . 56
8.1.2 ETSI GR MEC-DEC 025 (V2.1.1) . 57
8.1.3 Draft ETSI GS MEC-DEC 032-1 (V0.0.3) . 57
8.1.4 ETSI GS CIM 009 (V1.2.1) . 57
8.1.5 ETSI GS QKD 014 (V1.1.1) . 57
8.1.6 ETSI TS 129 501 (V15.3.0) . 57
8.1.7 ETSI GS NFV-SOL 013 (V2.7.1) . 58
8.1.8 ETSI GS NFV-SOL 015 (V1.1.1) . 58
8.1.9 ETSI GS NFV-TST 010 (V2.4.1) . 58
8.1.10 ETSI TS 118 115 (V2.0.0) . 58
8.1.11 oneM2M TS-0018 (V3.2.0) . 59
8.1.12 TM Forum Open APIs initiative . 59
8.1.13 OMG hData RESTful Transport . 59
8.1.14 OASIS OData v4.01 . 59
8.2 API adoption survey . 60
Annex A (informative): Bibliography . 62
Annex B (informative): Change History . 63
History . 64
ETSI
---------------------- Page: 4 ----------------------
5 Final draft ETSI EG 203 647 V1.1.1 (2020-09)
Intellectual Property Rights
Essential patents
IPRs essential or potentially essential to normative deliverables may have been declared to ETSI. The information
pertaining to these essential IPRs, if any, is publicly available for ETSI members and non-members, and can be found
in ETSI SR 000 314: "Intellectual Property Rights (IPRs); Essential, or potentially Essential, IPRs notified to ETSI in
respect of ETSI standards", which is available from the ETSI Secretariat. Latest updates are available on the ETSI Web
server (https://ipr.etsi.org/).
Pursuant to the ETSI IPR Policy, no investigation, including IPR searches, has been carried out by ETSI. No guarantee
can be given as to the existence of other IPRs not referenced in ETSI SR 000 314 (or the updates on the ETSI Web
server) which are, or may be, or may become, essential to the present document.
Trademarks
The present document may include trademarks and/or tradenames which are asserted and/or registered by their owners.
ETSI claims no ownership of these except for any which are indicated as being the property of ETSI, and conveys no
right to use or reproduce any trademark and/or tradename. Mention of those trademarks in the present document does
not constitute an endorsement by ETSI of products, services or organizations associated with those trademarks.
Foreword
This final draft ETSI Guide (EG) has been produced by ETSI Technical Committee Methods for Testing and
Specification (MTS), and is now submitted for the ETSI standards Membership Approval Procedure.
Modal verbs terminology
In the present document "should", "should not", "may", "need not", "will", "will not", "can" and "cannot" are to be
interpreted as described in clause 3.2 of the ETSI Drafting Rules (Verbal forms for the expression of provisions).
"must" and "must not" are NOT allowed in ETSI deliverables except when used in direct citation.
Executive Summary
The present document offers a report of standardization activities for telecommunication interfaces and application
programming interfaces based on the REpresentational State Transfer paradigm (RESTful APIs).
The guide collects conventions, methodology and design patterns from ETSI groups and from the industry and proposes
consolidated guidelines to serve the complete lifecycle of standardization, from design to validation.
Introduction
More and more telecommunication and digital interfaces are being implemented as software-based solutions.
A well-known and largely adopted design methodology is taking place across several standardization activities: using
the REpresentational State Transfer (REST) paradigm and resource-oriented protocols (e.g. HTTP(S), CoAP) or other
possibly applicable protocols (MQTT, AMQP).
This phenomenon is becoming common practice in ETSI Technical Bodies (TBs) and Industry Specification Groups
(ISGs) as well as in ETSI's Partnership Projects standardization activities, across several technologies, often quite
different in scope and user community.
ETSI
---------------------- Page: 5 ----------------------
6 Final draft ETSI EG 203 647 V1.1.1 (2020-09)
As adoption of standardizing RESTful APIs rises, it is becoming clear that specification of "RESTful APIs" needs to be:
• Fast, as the interfaces are simpler than other approaches and tend to have a shorter lifespan.
• Automatable, given the high number of conventions in the design of an API, parts of the specification,
implementation and testing process are well suited to be automated.
• Developer friendly, since developers need support in the discovery and implementation of the interfaces by
using tools and methodologies more closely aligned with software development.
In this regard, the present Guide for RESTful API specification and testing intends to support:
• Consolidation of efforts among different standardization groups and activities, who would be able to leverage
from others' experience.
• Delivery time of specifications to be spent on the design of the application level features, more than re-
assessing the principles and details at a transport protocol level.
• Standards quality to meet the excellence expected in the whole lifecycle of standardization, such as design,
specification, testability and interoperability validation.
Several TBs and ISGs have already specified RESTful APIs and documented their conventions and processes in group
specific guidelines. Further initiatives will be carried out during the upcoming years by the same groups as well as new
ones, therefore it is strategic to align and consolidate the standardization efforts among ETSI membership.
The present document is structured as follows:
• clause 4 introduces the main concepts and terminology for the RESTful approach, then presents
recommendations for RESTful API specifications development, with the introduction of a code-first approach
and discussion of the foreseen benefits of its application;
• clause 5 presents recommendation and methodology for development of test specifications for RESTful APIs;
• clause 6 collects best practices and references to the available tools to manipulate and present the code needed
artefacts;
• clause 7 contains a collection of examples on the expected outcomes of the different parts of the presented
methodology;
• clause 8 reports on the outcomes from the analysis of the base documents - from ETSI groups or from other
organizations - for the preparation of the present work and the results of a survey conducted among ETSI
delegates on REST APIs adoption.
ETSI
---------------------- Page: 6 ----------------------
7 Final draft ETSI EG 203 647 V1.1.1 (2020-09)
1 Scope
The scope of the present document is to present a methodology for specification and testing of RESTful APIs,
i.e. telecommunication interfaces based on the Representational State Transfer paradigm, suitable for application in the
standardization context.
In particular, the present guide is meant to serve ETSI membership and groups in the effort to unify and consolidate the
approaches and practices in current and future standardization activities at ETSI and its Partnership Projects.
The Guide collects the best practices from standardization, industry and research in order to provide a modern and
future-proofed approach to the subject.
The intended audience is primarily standardization groups at ETSI, but the guide may also serve as reference for users
and vendors in industry, with a special focus in Open Source communities.
The Guide recommendations on conventions, methodologies, design-patterns and architectural choices to be used in
standardization of RESTful APIs, specification and execution of standardized conformance and interoperability test
suites.
2 References
2.1 Normative references
Normative references are not applicable in the present document.
2.2 Informative references
References are either specific (identified by date of publication and/or edition number or version number) or
non-specific. For specific references, only the cited version applies. For non-specific references, the latest version of the
referenced document (including any amendments) applies.
NOTE: While any hyperlinks included in this clause were valid at the time of publication, ETSI cannot guarantee
their long-term validity.
The following referenced documents are not necessary for the application of the present document, but they assist the
user with regard to a particular subject area.
[i.1] "A Guide to Writing World Class Standards".
NOTE: Available at
https://portal.etsi.org/Portals/0/TBpages/edithelp/Docs/AGuideToWritingWorldClassStandards.pdf?ver=
2014-05-19-124137-453.
[i.2] Recommendation ITU-T I.130: "Method for the characterization of telecommunication services
supported by an ISDN and network capabilities of an ISDN".
[i.3] IETF RFC 5023: "The Atom Publishing Protocol".
[i.4] ETSI EG 203 130: "Methods for Testing and Specification (MTS); Model-Based Testing (MBT);
Methodology for standardized test specification development".
[i.5] IETF RFC 7231: "Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content".
[i.6] IETF RFC 8259: "The JavaScript Object Notation (JSON) Data Interchange Format".
[i.7] "The State of API 2019 survey", SmartBear.
[i.8] ETSI EG 201 015: "Methods for Testing and Specification (MTS); Standards engineering process;
A Handbook of validation methods".
ETSI
---------------------- Page: 7 ----------------------
8 Final draft ETSI EG 203 647 V1.1.1 (2020-09)
[i.9] ETSI EG 201 058 (V1.2.4): "Methods for Testing and Specification (MTS); Implementation
Conformance Statement (ICS); proforma style guide".
[i.10] Repository of attachments for ETSI EG 203 647 on ETSI Forge.
NOTE: Available at https://forge.etsi.org/rep/mts/eg-203647-restful-api-guide.
[i.11] ETSI Forge Platform.
NOTE: Available at https://forge.etsi.org.
[i.12] ETSI Labs Platform.
NOTE: Available at https://labs.etsi.org.
[i.13] TDL Open Source Project.
NOTE: Available at https://top.etsi.org.
[i.14] "YAML Ain't Markup Language (YAML™) Version 1.2" specification.
NOTE: Available at https://yaml.org/spec/1.2/spec.html.
[i.15] OpenAPI™ specification, Version 3.0.3.
NOTE: Available at https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.3.md.
[i.16] JSON Schema definition.
NOTE: Available at https://json-schema.org/.
[i.17] IETF RFC 3986: "Uniform Resource Identifier (URI): Generic Syntax".
NOTE: Available at https://tools.ietf.org/html/rfc3986.
[i.18] IETF RFC 2388: "Returning Values from Forms: multipart/form-data".
NOTE: Available at https://tools.ietf.org/html/rfc2388.
[i.19] IETF RFC 1738: "Uniform Resource Locators (URL)".
NOTE: Available at https://tools.ietf.org/html/rfc1738.
[i.20] ETSI Drafting Rules.
NOTE: Available at https://portal.etsi.org/Services/editHelp/How-to-start/ETSI-Drafting-Rules.
[i.21] ETSI TS 129 501 (V15.3.0): "5G; 5G System; Principles and Guidelines for Services Definition;
Stage 3 (3GPP TS 29.501 version 15.3.0 Release 15)".
[i.22] ETSI GS NFV-SOL 015 (V1.1.1): "Network Functions Virtualisation (NFV); Protocols and Data
Models; Specification of
...
SLOVENSKI STANDARD
SIST EG 203 647 V1.1.1:2021
01-junij-2021
Metode za preskušanje in specificiranje (MTS) - Metodologija za RESTful APIs
specifikacije in preskušanje
Methods for Testing and Specification (MTS) - Methodology for RESTful APIs
specifications and testing
Ta slovenski standard je istoveten z: ETSI EG 203 647 V1.1.1 (2020-11)
ICS:
33.020 Telekomunikacije na splošno Telecommunications in
general
SIST EG 203 647 V1.1.1:2021 en
2003-01.Slovenski inštitut za standardizacijo. Razmnoževanje celote ali delov tega standarda ni dovoljeno.
---------------------- Page: 1 ----------------------
SIST EG 203 647 V1.1.1:2021
---------------------- Page: 2 ----------------------
SIST EG 203 647 V1.1.1:2021
ETSI EG 203 647 V1.1.1 (2020-11)
ETSI GUIDE
Methods for Testing and Specification (MTS);
Methodology for RESTful APIs specifications and testing
---------------------- Page: 3 ----------------------
SIST EG 203 647 V1.1.1:2021
2 ETSI EG 203 647 V1.1.1 (2020-11)
Reference
DEG/MTS-203647
Keywords
API, methodology, testing
ETSI
650 Route des Lucioles
F-06921 Sophia Antipolis Cedex - FRANCE
Tel.: +33 4 92 94 42 00 Fax: +33 4 93 65 47 16
Siret N° 348 623 562 00017 - NAF 742 C
Association à but non lucratif enregistrée à la
Sous-Préfecture de Grasse (06) N° 7803/88
Important notice
The present document can be downloaded from:
http://www.etsi.org/standards-search
The present document may be made available in electronic versions and/or in print. The content of any electronic and/or
print versions of the present document shall not be modified without the prior written authorization of ETSI. In case of any
existing or perceived difference in contents between such versions and/or in print, the prevailing version of an ETSI
deliverable is the one made publicly available in PDF format at www.etsi.org/deliver.
Users of the present document should be aware that the document may be subject to revision or change of status.
Information on the current status of this and other ETSI documents is available at
https://portal.etsi.org/TB/ETSIDeliverableStatus.aspx
If you find errors in the present document, please send your comment to one of the following services:
https://portal.etsi.org/People/CommiteeSupportStaff.aspx
Copyright Notification
No part may be reproduced or utilized in any form or by any means, electronic or mechanical, including photocopying
and microfilm except as authorized by written permission of ETSI.
The content of the PDF version shall not be modified without the written authorization of ETSI.
The copyright and the foregoing restriction extend to reproduction in all media.
© ETSI 2020.
All rights reserved.
DECT™, PLUGTESTS™, UMTS™ and the ETSI logo are trademarks of ETSI registered for the benefit of its Members.
3GPP™ and LTE™ are trademarks of ETSI registered for the benefit of its Members and
of the 3GPP Organizational Partners.
oneM2M™ logo is a trademark of ETSI registered for the benefit of its Members and
of the oneM2M Partners.
®
GSM and the GSM logo are trademarks registered and owned by the GSM Association.
ETSI
---------------------- Page: 4 ----------------------
SIST EG 203 647 V1.1.1:2021
3 ETSI EG 203 647 V1.1.1 (2020-11)
Contents
Intellectual Property Rights . 5
Foreword . 5
Modal verbs terminology . 5
Executive Summary . 5
Introduction . 5
1 Scope . 7
2 References . 7
2.1 Normative references . 7
2.2 Informative references . 7
3 Definition of terms, symbols and abbreviations . 10
3.1 Terms . 10
3.2 Symbols . 11
3.3 Abbreviations . 11
4 Specification methodologies for RESTful APIs. 12
4.1 RESTful APIs specification in a staged standardization approach . 12
4.2 Introduction on RESTful interfaces . 13
4.2.1 Introduction. 13
4.2.2 Main Principles of the RESTful paradigm . 13
4.2.3 HTTP Methods and their Usage . 14
4.2.3.1 Overview . 14
4.2.3.2 POST . 14
4.2.3.3 GET . 14
4.2.3.4 PUT/PATCH . 14
4.2.3.5 DELETE . 15
4.2.4 Error Reporting . 15
4.2.4.1 Overview . 15
4.2.4.2 Client Errors . 16
4.2.4.3 Server Errors . 16
4.3 API specification process . 17
4.3.1 RESTful interface description languages . 17
4.3.2 Standardizing RESTful interfaces using OpenAPI . 17
4.3.2.1 OpenAPI Overview . 17
4.3.2.2 Document . 18
4.3.2.3 Data types . 18
4.3.2.4 Operations . 19
4.3.2.5 Requests . 20
4.3.2.6 Responses . 21
4.3.2.7 Callbacks . 22
4.3.2.8 Query parameters . 23
4.3.2.9 Extensions . 23
4.3.2.10 Other . 24
4.3.2.11 Process . 25
4.4 Common Patterns . 26
4.4.1 Filtering Patterns . 26
4.4.1.1 Overview . 26
4.4.1.2 Attribute-based filtering for collections . 26
4.4.1.3 Attribute Selector . 27
4.4.1.4 Pagination. 28
4.4.2 Pattern for URI Creation . 28
4.4.2.1 Resource URI Structure . 28
4.4.2.2 Design Rules for REST API URI . 29
4.4.3 Pattern to avoid Update Conflict and Data loss . 29
4.4.3.1 Description . 29
ETSI
---------------------- Page: 5 ----------------------
SIST EG 203 647 V1.1.1:2021
4 ETSI EG 203 647 V1.1.1 (2020-11)
4.4.4 Authorization and Authentication . 30
4.4.4.1 Overview . 30
4.4.4.2 API Authorization using OAuth 2.0 Access tokens . 31
4.4.4.3 API Authorization using TLS Certificates . 31
4.4.4.4 API Authorization using OpenID connect with JWT ID Token . 32
4.4.5 Non-CRUD operations . 33
4.4.5.1 Description . 33
4.5 Naming conventions . 34
4.6 Versioning . 36
4.6.1 Specifications and OpenAPI definitions versions . 36
4.6.2 Modelling version information . 37
4.7 Implementation . 37
5 Testing methodology for REST APIs . 38
5.1 Overview . 38
5.2 Testing Frameworks and Methodologies . 38
5.3 Conformance and Interoperability Testing . 39
5.3.1 General . 39
5.3.2 RESTful API-specific . 40
5.3.3 Domain-specific . 40
5.4 Test Specification Development . 40
5.4.1 General . 40
5.4.2 RESTful API-specific . 42
5.4.3 Domain-specific . 52
5.5 Test Deployment and Execution . 52
5.6 Test Maintenance and Evolution . 53
6 Tooling recommendations . 53
6.1 Introduction . 53
6.2 Design and drafting . 53
6.2.1 Overview . 53
6.2.2 Recommendations on editing tool selection . 54
6.3 Coordination and collaboration . 54
6.4 Validation and quality check . 54
6.5 Post processing . 55
7 Working Examples . 56
8 Survey of Activities at ETSI and Beyond . 56
8.1 Review of base documents . 56
8.1.1 ETSI GS MEC 009 (V2.1.1) . 56
8.1.2 ETSI GR MEC-DEC 025 (V2.1.1) . 57
8.1.3 Draft ETSI GS MEC-DEC 032-1 (V0.0.3) . 57
8.1.4 ETSI GS CIM 009 (V1.2.1) . 57
8.1.5 ETSI GS QKD 014 (V1.1.1) . 57
8.1.6 ETSI TS 129 501 (V15.3.0) . 57
8.1.7 ETSI GS NFV-SOL 013 (V2.7.1) . 58
8.1.8 ETSI GS NFV-SOL 015 (V1.1.1) . 58
8.1.9 ETSI GS NFV-TST 010 (V2.4.1) . 58
8.1.10 ETSI TS 118 115 (V2.0.0) . 58
8.1.11 oneM2M TS-0018 (V3.2.0) . 59
8.1.12 TM Forum Open APIs initiative . 59
8.1.13 OMG hData RESTful Transport . 59
8.1.14 OASIS OData v4.01 . 59
8.2 API adoption survey . 60
Annex A (informative): Bibliography . 62
Annex B (informative): Change History . 63
History . 64
ETSI
---------------------- Page: 6 ----------------------
SIST EG 203 647 V1.1.1:2021
5 ETSI EG 203 647 V1.1.1 (2020-11)
Intellectual Property Rights
Essential patents
IPRs essential or potentially essential to normative deliverables may have been declared to ETSI. The information
pertaining to these essential IPRs, if any, is publicly available for ETSI members and non-members, and can be found
in ETSI SR 000 314: "Intellectual Property Rights (IPRs); Essential, or potentially Essential, IPRs notified to ETSI in
respect of ETSI standards", which is available from the ETSI Secretariat. Latest updates are available on the ETSI Web
server (https://ipr.etsi.org/).
Pursuant to the ETSI IPR Policy, no investigation, including IPR searches, has been carried out by ETSI. No guarantee
can be given as to the existence of other IPRs not referenced in ETSI SR 000 314 (or the updates on the ETSI Web
server) which are, or may be, or may become, essential to the present document.
Trademarks
The present document may include trademarks and/or tradenames which are asserted and/or registered by their owners.
ETSI claims no ownership of these except for any which are indicated as being the property of ETSI, and conveys no
right to use or reproduce any trademark and/or tradename. Mention of those trademarks in the present document does
not constitute an endorsement by ETSI of products, services or organizations associated with those trademarks.
Foreword
This ETSI Guide (EG) has been produced by ETSI Technical Committee Methods for Testing and Specification (MTS).
Modal verbs terminology
In the present document "should", "should not", "may", "need not", "will", "will not", "can" and "cannot" are to be
interpreted as described in clause 3.2 of the ETSI Drafting Rules (Verbal forms for the expression of provisions).
"must" and "must not" are NOT allowed in ETSI deliverables except when used in direct citation.
Executive Summary
The present document offers a report of standardization activities for telecommunication interfaces and application
programming interfaces based on the REpresentational State Transfer paradigm (RESTful APIs).
The guide collects conventions, methodology and design patterns from ETSI groups and from the industry and proposes
consolidated guidelines to serve the complete lifecycle of standardization, from design to validation.
Introduction
More and more telecommunication and digital interfaces are being implemented as software-based solutions.
A well-known and largely adopted design methodology is taking place across several standardization activities: using
the REpresentational State Transfer (REST) paradigm and resource-oriented protocols (e.g. HTTP(S), CoAP) or other
possibly applicable protocols (MQTT, AMQP).
This phenomenon is becoming common practice in ETSI Technical Bodies (TBs) and Industry Specification Groups
(ISGs) as well as in ETSI's Partnership Projects standardization activities, across several technologies, often quite
different in scope and user community.
As adoption of standardizing RESTful APIs rises, it is becoming clear that specification of "RESTful APIs" needs to be:
• Fast, as the interfaces are simpler than other approaches and tend to have a shorter lifespan.
ETSI
---------------------- Page: 7 ----------------------
SIST EG 203 647 V1.1.1:2021
6 ETSI EG 203 647 V1.1.1 (2020-11)
• Automatable, given the high number of conventions in the design of an API, parts of the specification,
implementation and testing process are well suited to be automated.
• Developer friendly, since developers need support in the discovery and implementation of the interfaces by
using tools and methodologies more closely aligned with software development.
In this regard, the present Guide for RESTful API specification and testing intends to support:
• Consolidation of efforts among different standardization groups and activities, who would be able to leverage
from others' experience.
• Delivery time of specifications to be spent on the design of the application level features, more than re-
assessing the principles and details at a transport protocol level.
• Standards quality to meet the excellence expected in the whole lifecycle of standardization, such as design,
specification, testability and interoperability validation.
Several TBs and ISGs have already specified RESTful APIs and documented their conventions and processes in group
specific guidelines. Further initiatives will be carried out during the upcoming years by the same groups as well as new
ones, therefore it is strategic to align and consolidate the standardization efforts among ETSI membership.
The present document is structured as follows:
• clause 4 introduces the main concepts and terminology for the RESTful approach, then presents
recommendations for RESTful API specifications development, with the introduction of a code-first approach
and discussion of the foreseen benefits of its application;
• clause 5 presents recommendation and methodology for development of test specifications for RESTful APIs;
• clause 6 collects best practices and references to the available tools to manipulate and present the code needed
artefacts;
• clause 7 contains a collection of examples on the expected outcomes of the different parts of the presented
methodology;
• clause 8 reports on the outcomes from the analysis of the base documents - from ETSI groups or from other
organizations - for the preparation of the present work and the results of a survey conducted among ETSI
delegates on REST APIs adoption.
ETSI
---------------------- Page: 8 ----------------------
SIST EG 203 647 V1.1.1:2021
7 ETSI EG 203 647 V1.1.1 (2020-11)
1 Scope
The scope of the present document is to present a methodology for specification and testing of RESTful APIs,
i.e. telecommunication interfaces based on the Representational State Transfer paradigm, suitable for application in the
standardization context.
In particular, the present guide is meant to serve ETSI membership and groups in the effort to unify and consolidate the
approaches and practices in current and future standardization activities at ETSI and its Partnership Projects.
The Guide collects the best practices from standardization, industry and research in order to provide a modern and
future-proofed approach to the subject.
The intended audience is primarily standardization groups at ETSI, but the guide may also serve as reference for users
and vendors in industry, with a special focus in Open Source communities.
The Guide recommendations on conventions, methodologies, design-patterns and architectural choices to be used in
standardization of RESTful APIs, specification and execution of standardized conformance and interoperability test
suites.
2 References
2.1 Normative references
Normative references are not applicable in the present document.
2.2 Informative references
References are either specific (identified by date of publication and/or edition number or version number) or
non-specific. For specific references, only the cited version applies. For non-specific references, the latest version of the
referenced document (including any amendments) applies.
NOTE: While any hyperlinks included in this clause were valid at the time of publication, ETSI cannot guarantee
their long-term validity.
The following referenced documents are not necessary for the application of the present document, but they assist the
user with regard to a particular subject area.
[i.1] "A Guide to Writing World Class Standards".
NOTE: Available at
https://portal.etsi.org/Portals/0/TBpages/edithelp/Docs/AGuideToWritingWorldClassStandards.pdf?ver=
2014-05-19-124137-453.
[i.2] Recommendation ITU-T I.130: "Method for the characterization of telecommunication services
supported by an ISDN and network capabilities of an ISDN".
[i.3] IETF RFC 5023: "The Atom Publishing Protocol".
[i.4] ETSI EG 203 130: "Methods for Testing and Specification (MTS); Model-Based Testing (MBT);
Methodology for standardized test specification development".
[i.5] IETF RFC 7231: "Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content".
[i.6] IETF RFC 8259: "The JavaScript Object Notation (JSON) Data Interchange Format".
[i.7] "The State of API 2019 survey", SmartBear.
[i.8] ETSI EG 201 015: "Methods for Testing and Specification (MTS); Standards engineering process;
A Handbook of validation methods".
ETSI
---------------------- Page: 9 ----------------------
SIST EG 203 647 V1.1.1:2021
8 ETSI EG 203 647 V1.1.1 (2020-11)
[i.9] ETSI EG 201 058 (V1.2.4): "Methods for Testing and Specification (MTS); Implementation
Conformance Statement (ICS); proforma style guide".
[i.10] Repository of attachments for ETSI EG 203 647 on ETSI Forge.
NOTE: Available at https://forge.etsi.org/rep/mts/eg-203647-restful-api-guide.
[i.11] ETSI Forge Platform.
NOTE: Available at https://forge.etsi.org.
[i.12] ETSI Labs Platform.
NOTE: Available at https://labs.etsi.org.
[i.13] TDL Open Source Project.
NOTE: Available at https://top.etsi.org.
[i.14] "YAML Ain't Markup Language (YAML™) Version 1.2" specification.
NOTE: Available at https://yaml.org/spec/1.2/spec.html.
[i.15] OpenAPI™ specification, Version 3.0.3.
NOTE: Available at https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.3.md.
[i.16] JSON Schema definition.
NOTE: Available at https://json-schema.org/.
[i.17] IETF RFC 3986: "Uniform
...
Questions, Comments and Discussion
Ask us and Technical Secretary will try to provide an answer. You can facilitate discussion about the standard in here.