{"id":36897329,"url":"https://github.com/keecon/restdocs-openapi3","last_synced_at":"2026-01-12T15:43:04.237Z","repository":{"id":37938109,"uuid":"462124358","full_name":"keecon/restdocs-openapi3","owner":"keecon","description":"Clone of ePages-de/restdocs-api-spec with class field type and constraint inference.","archived":false,"fork":false,"pushed_at":"2025-04-22T02:24:43.000Z","size":539,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-22T04:12:52.200Z","etag":null,"topics":["openapi3","spring","spring-boot","spring-rest-docs"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/keecon.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-02-22T03:33:26.000Z","updated_at":"2025-04-22T02:24:39.000Z","dependencies_parsed_at":"2024-01-30T03:26:44.376Z","dependency_job_id":"5dc0303d-7064-45f5-ab72-19c951499b02","html_url":"https://github.com/keecon/restdocs-openapi3","commit_stats":null,"previous_names":[],"tags_count":33,"template":false,"template_full_name":null,"purl":"pkg:github/keecon/restdocs-openapi3","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keecon%2Frestdocs-openapi3","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keecon%2Frestdocs-openapi3/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keecon%2Frestdocs-openapi3/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keecon%2Frestdocs-openapi3/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/keecon","download_url":"https://codeload.github.com/keecon/restdocs-openapi3/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/keecon%2Frestdocs-openapi3/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28341505,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T12:22:26.515Z","status":"ssl_error","status_checked_at":"2026-01-12T12:22:10.856Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["openapi3","spring","spring-boot","spring-rest-docs"],"created_at":"2026-01-12T15:43:04.167Z","updated_at":"2026-01-12T15:43:04.227Z","avatar_url":"https://github.com/keecon.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Spring REST Docs OpenAPI 3 Specification\n\n[![jitpack-badge]](https://jitpack.io/#keecon/restdocs-openapi3)\n[![build-badge]](https://github.com/keecon/restdocs-openapi3/actions/workflows/build.yml)\n[![codecov-badge]](https://codecov.io/gh/keecon/restdocs-openapi3)\n[![sonarcloud-badge]](https://sonarcloud.io/summary/new_code?id=keecon_restdocs-openapi3)\n[![license-badge]](https://github.com/keecon/restdocs-openapi3/blob/main/LICENSE)\n\nA modified version of the [ePages-de/restdocs-api-spec] with class field type and constraint inference.\nAnd only support [OpenAPI 3.0.1] specs.\n\n## Build configuration\n\n### Versions\n\n- The *1.x.x* version is compatible with Spring Boot *3.0.x* and Spring REST Docs *3.0.x*.\n- The *0.x.x* version is compatible with Spring Boot *2.7.x* and Spring REST Docs *2.0.x*.\n\n### Gradle\n\n1. Add the plugin\n\n    ```groovy\n    buildscript() {\n      repositories {\n        // ...\n        maven { url \"https://jitpack.io\" }\n      }\n      dependencies {\n        // ...\n        classpath 'com.github.keecon:restdocs-openapi3:x.x.x'\n      }\n    }\n\n    plugins {\n      // ...\n      id 'com.github.keecon:restdocs-openapi3'\n    }\n    ```\n\n2. Add required dependencies to your tests\n\n    ```groovy\n    repositories {\n      // ...\n      maven { url 'https://jitpack.io' }\n    }\n\n    dependencies {\n      //..\n      testImplementation 'com.github.keecon:restdocs-openapi3:x.x.x'\n    }\n\n    openapi3 {\n      server = 'http://localhost:8080'\n      title = 'My API'\n      description = 'My API description'\n      tagDescriptionsPropertiesFile = 'src/test/resources/openapi-tags.yml'\n      version = '0.1.0'\n      format = 'yaml'\n    }\n    ```\n\n## Usage with Spring REST Docs\n\n```groovy\nwhen:\ndef resultActions = mockMvc.perform(\n  post('/v1/products/{productId}/result', 1)\n    .contentType(MediaType.APPLICATION_JSON)\n    .content(objectMapper.writeValueAsBytes(new ProductResultCreateRequestBody(result)))\n    .accept(MediaType.APPLICATION_JSON)\n)\n\nthen:\ndef reqModel = Constraints.model(ProductResultCreateRequest.class)\ndef reqBodyModel = Constraints.model(ProductResultCreateRequestBody.class)\ndef respModel = Constraints.model(ProductResultCreateResponse.class)\nresultActions\n  .andExpect(status().isOk())\n  .andDo(document('products-id-result-post',\n    resource(ResourceSnippetParameters.builder()\n      .tag('product')\n      .summary('Create a product result')\n      .description('''\n        |Create a product result\n        |\n        |### Error details\n        |\n        |`400` BAD_REQUEST\n        |- bad request description\n        |\n        |`401` UNAUTHORIZED\n        |- unauthorized description\n        |\n        |'''.stripMargin())\n      .requestSchema(schema('ProductResultCreateRequest'))\n      .pathParameters(\n        reqModel.withName('productId').description('product id'),\n      )\n      .requestFields(\n        reqBodyModel.withPath('result').description('product result'),\n        reqBodyModel.withPath('result.code').description('product result code'),\n        reqBodyModel.withPath('result.seq').description('product result seq'),\n        reqBodyModel.withPath('result.score').description('product result score'),\n        reqBodyModel.withPath('result.assigns[]').description('result assign object list'),\n        reqBodyModel.withPath('result.assigns[].code').description('result assign code'),\n        reqBodyModel.withPath('result.assigns[].seq').description('result assign seq'),\n        reqBodyModel.withPath('result.assigns[].objectId').description('result assign object id'),\n        reqBodyModel.withPath('result.assigns[].fileType').description('result assign file type')\n          .optional(),\n        reqBodyModel.withPath('result.assigns[].fileUrl').description('result assign file url')\n          .optional(),\n        reqBodyModel.withPath('result.assigns[].comments[]').description('result assign comment list')\n          .type(DataType.ARRAY)\n          .attributes(Attributes.items(DataType.STRING, null, null))\n          .optional(),\n      )\n      .responseSchema(schema('ProductResultCreateResponse'))\n      .responseFields(\n        respModel.withPath('status').description('operation status'),\n        respModel.withPath('code').description('product result code')\n          .optional(),\n      )\n      .build())))\n```\n\n```groovy\nwhen:\ndef resultActions = mockMvc.perform(\n  get('/v1/products/{productId}/result?code={code}', 1, 1)\n    .accept(MediaType.APPLICATION_JSON)\n)\n\nthen:\ndef reqModel = Constraints.model(ProductResultRequest.class)\ndef respModel = Constraints.model(ProductResultResponse.class)\nresultActions\n  .andExpect(status().isOk())\n  .andDo(document('products-id-result-code-get',\n    resource(ResourceSnippetParameters.builder()\n      .tag('product')\n      .summary('Get a product result info')\n      .description('''\n        |Get a product result info\n        |\n        |### Error details\n        |\n        |`400` BAD_REQUEST\n        |- bad request description\n        |\n        |`401` UNAUTHORIZED\n        |- unauthorized description\n        |\n        |`404` NOT_FOUND\n        |- not found description\n        |\n        |'''.stripMargin())\n      .requestSchema(schema('ProductResultRequest'))\n      .pathParameters(\n        reqModel.withName('productId').description('product id'),\n      )\n      .queryParameters(\n        reqModel.withName('code').description('product result code'),\n        reqModel.withName('seq').description('product result seq')\n          .defaultValue(ProductResultRequest.DEFAULT_RESULT_SEQ)\n          .optional(),\n      )\n      .responseSchema(schema('ProductResultResponse'))\n      .responseFields(\n        respModel.withPath('result').description('product result'),\n        respModel.withPath('result.code').description('product result code'),\n        respModel.withPath('result.seq').description('product result seq'),\n        respModel.withPath('result.score').description('product result score'),\n        respModel.withPath('result.assigns[]').description('result assign object list'),\n        respModel.withPath('result.assigns[].code').description('result assign code'),\n        respModel.withPath('result.assigns[].seq').description('result assign seq'),\n        respModel.withPath('result.assigns[].objectId').description('result assign object id'),\n        respModel.withPath('result.assigns[].fileType').description('result assign file type')\n          .optional(),\n        respModel.withPath('result.assigns[].fileUrl').description('result assign file url')\n          .optional(),\n        respModel.withPath('result.assigns[].comments[]').description('result assign comment list')\n          .type(DataType.ARRAY)\n          .attributes(Attributes.items(DataType.STRING, null, null))\n          .optional(),\n      )\n      .build())))\n```\n\n[jitpack-badge]: https://jitpack.io/v/keecon/restdocs-openapi3.svg\n\n[build-badge]: https://github.com/keecon/restdocs-openapi3/actions/workflows/build.yml/badge.svg\n\n[codecov-badge]: https://codecov.io/gh/keecon/restdocs-openapi3/branch/main/graph/badge.svg?token=TRQZ6GOVK4\n\n[sonarcloud-badge]: https://sonarcloud.io/api/project_badges/measure?project=keecon_restdocs-openapi3\u0026metric=alert_status\n\n[license-badge]: https://img.shields.io/github/license/keecon/restdocs-openapi3.svg\n\n[ePages-de/restdocs-api-spec]: https://github.com/ePages-de/restdocs-api-spec\n\n[OpenAPI 3.0.1]: https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.1.md\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeecon%2Frestdocs-openapi3","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkeecon%2Frestdocs-openapi3","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkeecon%2Frestdocs-openapi3/lists"}