{"id":313,"date":"2023-03-13T19:14:32","date_gmt":"2023-03-13T19:14:32","guid":{"rendered":"https:\/\/valerio.nu\/?p=313"},"modified":"2023-03-13T19:14:33","modified_gmt":"2023-03-13T19:14:33","slug":"documenting-restful-api-using-swagger-openapi","status":"publish","type":"post","link":"https:\/\/valerio.nu\/index.php\/2023\/03\/13\/documenting-restful-api-using-swagger-openapi\/","title":{"rendered":"Documenting Restful API using Swagger\/OpenApi"},"content":{"rendered":"\n<h3 class=\"wp-block-heading\">Introduction<\/h3>\n\n\n\n<p>API provides an application pluggable interface for integration by front-end apps. They have become prominent in modern-day programming principles. As technology continues to evolve, industry application flow continues to adjust as well. Today, we will discuss and show how easy it is to add OpenApi using Swaggerfox into your Spring Boot application.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">What is Swagger\/OpenApi<\/h3>\n\n\n\n<p><a href=\"https:\/\/swagger.io\/\">Swagger<\/a> (now referred to as OpenAPI) is a set of specifications for building and documenting RESTful APIs. It provides a standard format for describing RESTful APIs in a machine-readable format, making it easier for developers to develop, test, and document APIs.<\/p>\n\n\n\n<p>OpenAPI is designed to be language-agnostic, meaning that it can be used with APIs built using any programming language. Thus, providing a write once, use everywhere approach. It provides a way to define endpoints, request and response parameters, and API operations. This information can be used to generate documentation, client SDKs, and server stubs.<\/p>\n\n\n\n<p>OpenAPI is composed of two parts: a YAML or JSON specification document that defines the API, and a set of tools that can be used to generate documentation, code, and test suites based on that specification. The specification document describes the endpoints, methods, requests, response payloads, and authentication methods used by the API.<\/p>\n\n\n\n<p>OpenAPI is widely used in the development of RESTful APIs and is supported by a large number of tools and frameworks, including Spring Boot, Node.js, Asp.Net, and many others.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Getting Started<\/h4>\n\n\n\n<p>To use Swagger in our application, we have to add the following dependencies in our pom.xml file.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Spring Boot 2.7 and above<\/li>\n\n\n\n<li>Java 1.8 and above<\/li>\n\n\n\n<li>Springfox Swagger2 v2.7.0<\/li>\n\n\n\n<li>Springfox Swagger-ui v2.7.0&nbsp;<\/li>\n\n\n\n<li>Springdoc OpenApi-ui v1.5.12<\/li>\n<\/ol>\n\n\n\n<p>What our pom.xml file looks like is shown in the code image below:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>                &lt;dependency&gt;\n\t\t\t&lt;groupId&gt;io.springfox&lt;\/groupId&gt;\n\t\t\t&lt;artifactId&gt;springfox-swagger2&lt;\/artifactId&gt;\n\t\t\t&lt;version&gt;2.7.0&lt;\/version&gt;\n\t\t&lt;\/dependency&gt;\n\n\t\t&lt;dependency&gt;\n\t\t\t&lt;groupId&gt;io.springfox&lt;\/groupId&gt;\n\t\t\t&lt;artifactId&gt;springfox-swagger-ui&lt;\/artifactId&gt;\n\t\t\t&lt;version&gt;2.7.0&lt;\/version&gt;\n\t\t&lt;\/dependency&gt;\n\t\t&lt;dependency&gt;\n\t\t\t&lt;groupId&gt;org.springdoc&lt;\/groupId&gt;\n\t\t\t&lt;artifactId&gt;springdoc-openapi-ui&lt;\/artifactId&gt;\n\t\t\t&lt;version&gt;1.5.12&lt;\/version&gt;\n\t\t&lt;\/dependency&gt;<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">Creating the configuration class<\/h4>\n\n\n\n<p>This class is used to introduce Swagger into our application. It consists of code blocks that will activate the various endpoints in our Controller class.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>package com.valerio.nu.springdatajpa.config;\n\nimport org.springframework.context.annotation.Bean;\nimport org.springframework.context.annotation.Configuration;\nimport org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;\nimport springfox.documentation.builders.ApiInfoBuilder;\nimport springfox.documentation.builders.PathSelectors;\nimport springfox.documentation.builders.RequestHandlerSelectors;\nimport springfox.documentation.service.ApiInfo;\nimport springfox.documentation.spi.DocumentationType;\nimport springfox.documentation.spring.web.plugins.Docket;\nimport springfox.documentation.swagger2.annotations.EnableSwagger2;\n@Configuration\npublic class SwaggerConfig {\n\n\n    @Bean\n    public Docket api() {\n        return new Docket(DocumentationType.SWAGGER_2)\n                .select()\n                .apis(RequestHandlerSelectors.any())\n                .paths(PathSelectors.any())\n                .build();\n    }\n\n    private ApiInfo apiInfo() {\n        return new ApiInfoBuilder()\n                .title(\"User Management API\")\n                .description(\"API documentation\")\n                .version(\"1.0.0\")\n                .build();\n    }\n}\n\n<\/code><\/pre>\n\n\n\n<p>From the code block above, we that a Docket bean was called, and its select() method returns an instance of ApiSelectorBuilder, which gives us access to control the endpoints exposed by Swagger. Further configuration includes the RequestHandler, helping us to determine the path selection by applying the RequestHandlerSelectors and PathSelectors. Using the any() function, we are able to scan through our endpoints, making swagger able to present our endpoints.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">The Controller and other annotations<\/h4>\n\n\n\n<p>The endpoints are found in our controller class alongside annotations that detail what each endpoint is doing. The code below presents our controller class. The @Api annotation on the controller class and @ApiOperation annotation on the controller methods provide additional information about the API that Swagger will use to generate documentation.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>package com.valerio.nu.springdatajpa.controller;\n\nimport com.valerio.nu.springdatajpa.model.User;\nimport com.valerio.nu.springdatajpa.service.SimpleUserImpl;\nimport com.valerio.nu.springdatajpa.service.UserRepository;\nimport io.swagger.annotations.Api;\nimport io.swagger.annotations.ApiOperation;\nimport org.hibernate.ObjectNotFoundException;\nimport org.springframework.hateoas.EntityModel;\nimport org.springframework.hateoas.Link;\nimport org.springframework.hateoas.server.mvc.WebMvcLinkBuilder;\nimport org.springframework.http.HttpEntity;\nimport org.springframework.http.HttpStatus;\nimport org.springframework.http.ResponseEntity;\nimport org.springframework.web.bind.annotation.*;\nimport static org.springframework.hateoas.server.mvc.WebMvcLinkBuilder.*;\nimport java.util.List;\n\n\n\n@CrossOrigin\n@RestController\n@RequestMapping(\"\/api\")\n@Api(value = \"User Controller\")\npublic class UserController {\n    private final SimpleUserImpl userService;\n\n    public UserController(SimpleUserImpl userService, UserRepository userRepository) {\n        this.userService = userService;\n    }\n\n    \/\/ Add\n    @PostMapping(value = \"\/users\")\n    @ApiOperation(value = \"Create a user\")\n    public User Post(@RequestBody User params) {\n        return userService.Post(params);\n    }\n\n\n\n    \/\/ Get\n    @GetMapping(value = \"\/users\")\n    @ApiOperation(value = \"Get all Users\")\n    public List&lt;User&gt; Get() {\n\n        return userService.Get();\n    }\n\n    \/\/ Get By ID\n    @GetMapping(value = \"\/users\/{id}\")\n    @ApiOperation(value = \"Get  a user\")\n    public EntityModel&lt;User&gt; Get(@PathVariable int id) {\n\n\n\n\n\n        User result = userService.Get(id);\n                if(result == null){\n                    throw new ObjectNotFoundException(\"no user exist with such id: \" ,  String.valueOf(id));\n                }\n\n            return EntityModel.of(result, \/\/\n                    WebMvcLinkBuilder.linkTo(WebMvcLinkBuilder.methodOn(this.getClass()).Get(id)).withSelfRel(),\n                    WebMvcLinkBuilder.linkTo(WebMvcLinkBuilder.methodOn(this.getClass()).Get()).withRel(\"all-users\"));\n\n\n    }\n\n\n\n    \/\/ Update\n    @PutMapping(value = \"\/users\/{id}\")\n    @ApiOperation(value = \"Update a user\")\n    public User Update(@PathVariable int id, @RequestBody User params) {\n        return userService.Update(params, id);\n    }\n\n    \/\/ Delete\n    @DeleteMapping(value = \"\/users\/{id}\")\n    @ApiOperation(value = \"Delete a user\")\n    public String Delete(@PathVariable int id) {\n        return userService.Delete(id);\n    }\n\n}<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"369\" src=\"https:\/\/valerio.nu\/wp-content\/uploads\/2023\/03\/Screenshot-2023-03-07-at-01.10.55-1024x369.png\" alt=\"\" class=\"wp-image-315\" srcset=\"https:\/\/valerio.nu\/wp-content\/uploads\/2023\/03\/Screenshot-2023-03-07-at-01.10.55-1024x369.png 1024w, https:\/\/valerio.nu\/wp-content\/uploads\/2023\/03\/Screenshot-2023-03-07-at-01.10.55-300x108.png 300w, https:\/\/valerio.nu\/wp-content\/uploads\/2023\/03\/Screenshot-2023-03-07-at-01.10.55-768x277.png 768w, https:\/\/valerio.nu\/wp-content\/uploads\/2023\/03\/Screenshot-2023-03-07-at-01.10.55-1536x554.png 1536w, https:\/\/valerio.nu\/wp-content\/uploads\/2023\/03\/Screenshot-2023-03-07-at-01.10.55-2048x738.png 2048w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><figcaption class=\"wp-element-caption\">Our Endpoints shown with Swagger<\/figcaption><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">Conclusion<\/h3>\n\n\n\n<p>We have presented a simple way to document Restful API using Swagger\/OpenApi in this tutorial. The application endpoints can be accessed using the localhost address (<a href=\"http:\/\/localhost:8080\/swagger-ui\/index.html\">http:\/\/localhost:8080\/swagger-ui\/index.html<\/a>). Essentially, the code for this tutorial can be found on our <a href=\"https:\/\/github.com\/valerio-nu\/restfful-swagger-documentation\">GitHub page<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction API provides an application pluggable interface for integration by front-end apps. They have become prominent in modern-day programming principles. As technology continues to evolve, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[],"class_list":["post-313","post","type-post","status-publish","format-standard","hentry","category-java"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Documenting Restful API using Swagger\/OpenApi - Andy&#039;s blog \u2935\ufe0f<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/valerio.nu\/index.php\/2023\/03\/13\/documenting-restful-api-using-swagger-openapi\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Documenting Restful API using Swagger\/OpenApi - Andy&#039;s blog \u2935\ufe0f\" \/>\n<meta property=\"og:description\" content=\"Introduction API provides an application pluggable interface for integration by front-end apps. They have become prominent in modern-day programming principles. As technology continues to evolve, [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/valerio.nu\/index.php\/2023\/03\/13\/documenting-restful-api-using-swagger-openapi\/\" \/>\n<meta property=\"og:site_name\" content=\"Andy&#039;s blog \u2935\ufe0f\" \/>\n<meta property=\"article:published_time\" content=\"2023-03-13T19:14:32+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-03-13T19:14:33+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/valerio.nu\/wp-content\/uploads\/2023\/03\/Screenshot-2023-03-07-at-01.10.55-1024x369.png\" \/>\n<meta name=\"author\" content=\"andy\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"andy\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/valerio.nu\\\/index.php\\\/2023\\\/03\\\/13\\\/documenting-restful-api-using-swagger-openapi\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/valerio.nu\\\/index.php\\\/2023\\\/03\\\/13\\\/documenting-restful-api-using-swagger-openapi\\\/\"},\"author\":{\"name\":\"andy\",\"@id\":\"https:\\\/\\\/valerio.nu\\\/#\\\/schema\\\/person\\\/da69cc3da309893b0d3bc8fcef75f128\"},\"headline\":\"Documenting Restful API using Swagger\\\/OpenApi\",\"datePublished\":\"2023-03-13T19:14:32+00:00\",\"dateModified\":\"2023-03-13T19:14:33+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/valerio.nu\\\/index.php\\\/2023\\\/03\\\/13\\\/documenting-restful-api-using-swagger-openapi\\\/\"},\"wordCount\":497,\"commentCount\":0,\"image\":{\"@id\":\"https:\\\/\\\/valerio.nu\\\/index.php\\\/2023\\\/03\\\/13\\\/documenting-restful-api-using-swagger-openapi\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/valerio.nu\\\/wp-content\\\/uploads\\\/2023\\\/03\\\/Screenshot-2023-03-07-at-01.10.55-1024x369.png\",\"articleSection\":[\"Java\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/valerio.nu\\\/index.php\\\/2023\\\/03\\\/13\\\/documenting-restful-api-using-swagger-openapi\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/valerio.nu\\\/index.php\\\/2023\\\/03\\\/13\\\/documenting-restful-api-using-swagger-openapi\\\/\",\"url\":\"https:\\\/\\\/valerio.nu\\\/index.php\\\/2023\\\/03\\\/13\\\/documenting-restful-api-using-swagger-openapi\\\/\",\"name\":\"Documenting Restful API using Swagger\\\/OpenApi - Andy&#039;s blog \u2935\ufe0f\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/valerio.nu\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/valerio.nu\\\/index.php\\\/2023\\\/03\\\/13\\\/documenting-restful-api-using-swagger-openapi\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/valerio.nu\\\/index.php\\\/2023\\\/03\\\/13\\\/documenting-restful-api-using-swagger-openapi\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/valerio.nu\\\/wp-content\\\/uploads\\\/2023\\\/03\\\/Screenshot-2023-03-07-at-01.10.55-1024x369.png\",\"datePublished\":\"2023-03-13T19:14:32+00:00\",\"dateModified\":\"2023-03-13T19:14:33+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/valerio.nu\\\/#\\\/schema\\\/person\\\/da69cc3da309893b0d3bc8fcef75f128\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/valerio.nu\\\/index.php\\\/2023\\\/03\\\/13\\\/documenting-restful-api-using-swagger-openapi\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/valerio.nu\\\/index.php\\\/2023\\\/03\\\/13\\\/documenting-restful-api-using-swagger-openapi\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/valerio.nu\\\/index.php\\\/2023\\\/03\\\/13\\\/documenting-restful-api-using-swagger-openapi\\\/#primaryimage\",\"url\":\"https:\\\/\\\/valerio.nu\\\/wp-content\\\/uploads\\\/2023\\\/03\\\/Screenshot-2023-03-07-at-01.10.55.png\",\"contentUrl\":\"https:\\\/\\\/valerio.nu\\\/wp-content\\\/uploads\\\/2023\\\/03\\\/Screenshot-2023-03-07-at-01.10.55.png\",\"width\":2936,\"height\":1058},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/valerio.nu\\\/index.php\\\/2023\\\/03\\\/13\\\/documenting-restful-api-using-swagger-openapi\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/valerio.nu\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Documenting Restful API using Swagger\\\/OpenApi\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/valerio.nu\\\/#website\",\"url\":\"https:\\\/\\\/valerio.nu\\\/\",\"name\":\"Andy&#039;s blog \u2935\ufe0f\",\"description\":\"Abandon all hope, ye who enter here\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/valerio.nu\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/valerio.nu\\\/#\\\/schema\\\/person\\\/da69cc3da309893b0d3bc8fcef75f128\",\"name\":\"andy\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4852a025c6250c852814d4017f646677730a23c1ec14eb5ca36b69dcce5135a5?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4852a025c6250c852814d4017f646677730a23c1ec14eb5ca36b69dcce5135a5?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/4852a025c6250c852814d4017f646677730a23c1ec14eb5ca36b69dcce5135a5?s=96&d=mm&r=g\",\"caption\":\"andy\"},\"sameAs\":[\"https:\\\/\\\/valerio.nu\"],\"url\":\"https:\\\/\\\/valerio.nu\\\/index.php\\\/author\\\/giuseppe\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Documenting Restful API using Swagger\/OpenApi - Andy&#039;s blog \u2935\ufe0f","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/valerio.nu\/index.php\/2023\/03\/13\/documenting-restful-api-using-swagger-openapi\/","og_locale":"en_US","og_type":"article","og_title":"Documenting Restful API using Swagger\/OpenApi - Andy&#039;s blog \u2935\ufe0f","og_description":"Introduction API provides an application pluggable interface for integration by front-end apps. They have become prominent in modern-day programming principles. As technology continues to evolve, [&hellip;]","og_url":"https:\/\/valerio.nu\/index.php\/2023\/03\/13\/documenting-restful-api-using-swagger-openapi\/","og_site_name":"Andy&#039;s blog \u2935\ufe0f","article_published_time":"2023-03-13T19:14:32+00:00","article_modified_time":"2023-03-13T19:14:33+00:00","og_image":[{"url":"https:\/\/valerio.nu\/wp-content\/uploads\/2023\/03\/Screenshot-2023-03-07-at-01.10.55-1024x369.png","type":"","width":"","height":""}],"author":"andy","twitter_card":"summary_large_image","twitter_misc":{"Written by":"andy","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/valerio.nu\/index.php\/2023\/03\/13\/documenting-restful-api-using-swagger-openapi\/#article","isPartOf":{"@id":"https:\/\/valerio.nu\/index.php\/2023\/03\/13\/documenting-restful-api-using-swagger-openapi\/"},"author":{"name":"andy","@id":"https:\/\/valerio.nu\/#\/schema\/person\/da69cc3da309893b0d3bc8fcef75f128"},"headline":"Documenting Restful API using Swagger\/OpenApi","datePublished":"2023-03-13T19:14:32+00:00","dateModified":"2023-03-13T19:14:33+00:00","mainEntityOfPage":{"@id":"https:\/\/valerio.nu\/index.php\/2023\/03\/13\/documenting-restful-api-using-swagger-openapi\/"},"wordCount":497,"commentCount":0,"image":{"@id":"https:\/\/valerio.nu\/index.php\/2023\/03\/13\/documenting-restful-api-using-swagger-openapi\/#primaryimage"},"thumbnailUrl":"https:\/\/valerio.nu\/wp-content\/uploads\/2023\/03\/Screenshot-2023-03-07-at-01.10.55-1024x369.png","articleSection":["Java"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/valerio.nu\/index.php\/2023\/03\/13\/documenting-restful-api-using-swagger-openapi\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/valerio.nu\/index.php\/2023\/03\/13\/documenting-restful-api-using-swagger-openapi\/","url":"https:\/\/valerio.nu\/index.php\/2023\/03\/13\/documenting-restful-api-using-swagger-openapi\/","name":"Documenting Restful API using Swagger\/OpenApi - Andy&#039;s blog \u2935\ufe0f","isPartOf":{"@id":"https:\/\/valerio.nu\/#website"},"primaryImageOfPage":{"@id":"https:\/\/valerio.nu\/index.php\/2023\/03\/13\/documenting-restful-api-using-swagger-openapi\/#primaryimage"},"image":{"@id":"https:\/\/valerio.nu\/index.php\/2023\/03\/13\/documenting-restful-api-using-swagger-openapi\/#primaryimage"},"thumbnailUrl":"https:\/\/valerio.nu\/wp-content\/uploads\/2023\/03\/Screenshot-2023-03-07-at-01.10.55-1024x369.png","datePublished":"2023-03-13T19:14:32+00:00","dateModified":"2023-03-13T19:14:33+00:00","author":{"@id":"https:\/\/valerio.nu\/#\/schema\/person\/da69cc3da309893b0d3bc8fcef75f128"},"breadcrumb":{"@id":"https:\/\/valerio.nu\/index.php\/2023\/03\/13\/documenting-restful-api-using-swagger-openapi\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/valerio.nu\/index.php\/2023\/03\/13\/documenting-restful-api-using-swagger-openapi\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/valerio.nu\/index.php\/2023\/03\/13\/documenting-restful-api-using-swagger-openapi\/#primaryimage","url":"https:\/\/valerio.nu\/wp-content\/uploads\/2023\/03\/Screenshot-2023-03-07-at-01.10.55.png","contentUrl":"https:\/\/valerio.nu\/wp-content\/uploads\/2023\/03\/Screenshot-2023-03-07-at-01.10.55.png","width":2936,"height":1058},{"@type":"BreadcrumbList","@id":"https:\/\/valerio.nu\/index.php\/2023\/03\/13\/documenting-restful-api-using-swagger-openapi\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/valerio.nu\/"},{"@type":"ListItem","position":2,"name":"Documenting Restful API using Swagger\/OpenApi"}]},{"@type":"WebSite","@id":"https:\/\/valerio.nu\/#website","url":"https:\/\/valerio.nu\/","name":"Andy&#039;s blog \u2935\ufe0f","description":"Abandon all hope, ye who enter here","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/valerio.nu\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/valerio.nu\/#\/schema\/person\/da69cc3da309893b0d3bc8fcef75f128","name":"andy","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/4852a025c6250c852814d4017f646677730a23c1ec14eb5ca36b69dcce5135a5?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/4852a025c6250c852814d4017f646677730a23c1ec14eb5ca36b69dcce5135a5?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/4852a025c6250c852814d4017f646677730a23c1ec14eb5ca36b69dcce5135a5?s=96&d=mm&r=g","caption":"andy"},"sameAs":["https:\/\/valerio.nu"],"url":"https:\/\/valerio.nu\/index.php\/author\/giuseppe\/"}]}},"_links":{"self":[{"href":"https:\/\/valerio.nu\/index.php\/wp-json\/wp\/v2\/posts\/313","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/valerio.nu\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/valerio.nu\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/valerio.nu\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/valerio.nu\/index.php\/wp-json\/wp\/v2\/comments?post=313"}],"version-history":[{"count":3,"href":"https:\/\/valerio.nu\/index.php\/wp-json\/wp\/v2\/posts\/313\/revisions"}],"predecessor-version":[{"id":318,"href":"https:\/\/valerio.nu\/index.php\/wp-json\/wp\/v2\/posts\/313\/revisions\/318"}],"wp:attachment":[{"href":"https:\/\/valerio.nu\/index.php\/wp-json\/wp\/v2\/media?parent=313"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/valerio.nu\/index.php\/wp-json\/wp\/v2\/categories?post=313"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/valerio.nu\/index.php\/wp-json\/wp\/v2\/tags?post=313"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}