Self-documentation for representational state transfer (REST) application programming interface (API)
First Claim
Patent Images
1. A method for documenting a representational state transfer (REST) resource, the method comprising:
- receiving an indication that a REST resource of an application is being accessed;
externally monitoring, by one or more processors, usage of the REST resource of the application utilizing a JAX-RS/servlet filter, including input JavaScript Object Notation (JSON) data to the REST resource of the application and output JSON data from the REST resource of the application, wherein the REST resource is provided by Java API for RESTful Web Services (JAX-RS);
determining, by one or more processors, whether a schema file exists for the REST resource of the application;
responsive to determining that the schema file does not exist, capturing, by one or more processors, a set of data from the monitored input JSON data to the REST resource of the application and the monitored output JSON data from the REST resource of the application;
converting, by one or more processors, the captured set of data from the monitored input JSON data and output JSON data Extensible Markup Language (XML) Schema (XSD);
storing, by one or more processors, the converted set of data from the monitored input JSON data and output JSON data;
receiving a request for documentation for the REST resource;
retrieving, by one or more processors, the converted set of data from the monitored input JSON data and output JSON data of the REST resource;
generating, by one or more processors, documentation for the REST resource, wherein the documentation is Web Application Description Language (WADL) format;
inserting, by one or more processors, the converted set of data from the monitored input JSON data and output JSON data within the documentation for the REST resource; and
returning, by one or more processors, the documentation with the converted set of data from the monitored input JSON data and output JSON data.
1 Assignment
0 Petitions
Accused Products
Abstract
In an approach for documenting a representational state transfer (REST) resource. A processor monitors input JavaScript Object Notation (JSON) data and output JSON data of a REST resource of an application. A processor converts a set of data from the monitored input JSON data and output JSON data of the REST resource to a self-documenting interchange format. A processor stores the converted set of data from the monitored input JSON data and output JSON data of the REST resource.
57 Citations
8 Claims
-
1. A method for documenting a representational state transfer (REST) resource, the method comprising:
-
receiving an indication that a REST resource of an application is being accessed; externally monitoring, by one or more processors, usage of the REST resource of the application utilizing a JAX-RS/servlet filter, including input JavaScript Object Notation (JSON) data to the REST resource of the application and output JSON data from the REST resource of the application, wherein the REST resource is provided by Java API for RESTful Web Services (JAX-RS); determining, by one or more processors, whether a schema file exists for the REST resource of the application; responsive to determining that the schema file does not exist, capturing, by one or more processors, a set of data from the monitored input JSON data to the REST resource of the application and the monitored output JSON data from the REST resource of the application; converting, by one or more processors, the captured set of data from the monitored input JSON data and output JSON data Extensible Markup Language (XML) Schema (XSD); storing, by one or more processors, the converted set of data from the monitored input JSON data and output JSON data; receiving a request for documentation for the REST resource; retrieving, by one or more processors, the converted set of data from the monitored input JSON data and output JSON data of the REST resource; generating, by one or more processors, documentation for the REST resource, wherein the documentation is Web Application Description Language (WADL) format; inserting, by one or more processors, the converted set of data from the monitored input JSON data and output JSON data within the documentation for the REST resource; and returning, by one or more processors, the documentation with the converted set of data from the monitored input JSON data and output JSON data. - View Dependent Claims (2, 3)
-
-
4. A computer program product for documenting a representational state transfer (REST) resource, the computer program product comprising:
-
one or more computer readable storage media, wherein the one or more computer readable storage media is not a transitory signal per se, and program instructions stored on the one or more computer readable storage media, the program instructions comprising; program instructions to receive an indication that a REST resource of an application is being accessed; program instructions to externally monitor usage of the REST resource of the application utilizing a JAX-RS/servlet filter, including input JavaScript Object Notation (JSON) data to the REST resource of the application and output JSON data of a from the REST resource of the application, wherein the REST resource is provided by Java API for RESTful Web Services (JAX-RS); program instructions to determine whether a schema file exists for the REST resource of the application; program instructions to, responsive to determining that the schema file does not exist, capture a set of data from the monitored input JSON data to the REST resource of the application and the monitored output JSON data from the REST resource of the application; program instructions to convert the captured set of data from the monitored input JSON data and output JSON data to Extensible Markup Language (XML) Schema (XSD); program instructions to store the converted set of data from the monitored input JSON data and output JSON data; program instructions to receive a request for documentation for the REST resource; program instructions to retrieve the converted set of data from the monitored input JSON data and output JSON data of the REST resource; program instructions to generate documentation for the REST resource, wherein the documentation is Web Application Description Language (WADL) format; program instructions to insert the converted set of data from the monitored input JSON data and output JSON data within the documentation for the REST resource; and program instructions to return the documentation with the converted set of data from the monitored input JSON data and output JSON data. - View Dependent Claims (5, 6)
-
-
7. A computer system for documenting a representational state transfer (REST) resource, the computer program product comprising:
-
one or more computer processors, one or more computer readable storage media, and program instructions stored on the computer readable storage media for execution by at least one of the one or more processors, the program instructions comprising; program instructions to receive an indication that a REST resource of an application is being accessed; program instructions to externally monitor usage of the REST resource of the application utilizing a JAX-RS/servlet filter, including input JavaScript Object Notation (JSON) data to the REST resource of the application and output JSON data from the REST resource of the application, wherein the REST resource is provided by Java API for RESTful Web Services (JAX-RS); program instructions to determine whether a schema file exists for the REST resource of the application; program instructions to, responsive to determining that the schema file does not exist, capture a set of data from the monitored input JSON data to the REST resource of the application and the monitored output JSON data from the REST resource of the application; program instructions to convert the captured set of data from the monitored input JSON data and output JSON data to Extensible Markup Language (XML) Schema (XSD); program instructions to store the converted set of data from the monitored input JSON data and output JSON data; program instructions to receive a request for documentation for the REST resource; program instructions to retrieve the converted set of data from the monitored input JSON data and output JSON data of the REST resource; program instructions to generate documentation for the REST resource, wherein the documentation is Web Application Description Language (WADL) format; program instructions to insert the converted set of data from the monitored input JSON data and output JSON data within the documentation for the REST resource; and program instructions to return the documentation with the converted set of data from the monitored input JSON data and output JSON data. - View Dependent Claims (8)
-
Specification