{"id":15597425,"url":"https://github.com/cdimascio/kotlin-spring-mvc-template","last_synced_at":"2025-04-28T10:46:39.459Z","repository":{"id":49738927,"uuid":"151765325","full_name":"cdimascio/kotlin-spring-mvc-template","owner":"cdimascio","description":"12-factor compliant Spring MVC Kotlin template. Features automatic request/response validation and interactive API doc","archived":false,"fork":false,"pushed_at":"2019-02-15T02:10:23.000Z","size":2657,"stargazers_count":23,"open_issues_count":0,"forks_count":8,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-18T15:16:33.554Z","etag":null,"topics":["dotenv","kotlin","openapi3","spring-boot","spring-mvc","swagger","swagger2"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cdimascio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-10-05T18:57:20.000Z","updated_at":"2024-11-19T12:58:03.000Z","dependencies_parsed_at":"2022-09-24T18:11:16.080Z","dependency_job_id":null,"html_url":"https://github.com/cdimascio/kotlin-spring-mvc-template","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdimascio%2Fkotlin-spring-mvc-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdimascio%2Fkotlin-spring-mvc-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdimascio%2Fkotlin-spring-mvc-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdimascio%2Fkotlin-spring-mvc-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cdimascio","download_url":"https://codeload.github.com/cdimascio/kotlin-spring-mvc-template/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251298005,"owners_count":21566937,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["dotenv","kotlin","openapi3","spring-boot","spring-mvc","swagger","swagger2"],"created_at":"2024-10-03T01:21:45.530Z","updated_at":"2025-04-28T10:46:39.430Z","avatar_url":"https://github.com/cdimascio.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# kotlin-spring-mvc-template\n\nSpring 5 MVC template with *Kotlin* and *OpenAPI 3.0*. (Also Supports *Swagger 2.0*)\n\nFeatures automatic request/response validation and interactive API doc\n\n\u003cp align=\"left\"\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/cdimascio/kotlin-spring-mvc-template/master/assets/spring-mvc-openapi.png\" width=\"600\"/\u003e\n\u003c/p\u003e\n\n**Features**:\n\n- Automatic request and response validation via atlassian [OpenApi 3.0](https://swagger.io/docs/specification/about/)\n- Automatic documentation generation via [Swagger UI](https://swagger.io/tools/swagger-ui/)\n- 12 factor compliant configuration via [java-dotenv](https://github.com/cdimascio/java-dotenv)\n- Automatic code formatting and linting via [ktlint](https://ktlint.github.io)\n- Fully operational sample REST API\n- API integration tests with [Unirest](http://unirest.io/java.html) REST client\n- Simple HTTP errors via [japi-errors](https://github.com/cdimascio/japi-errors)\n- Dockerfile\n\n## Setup\n\n- Clone this repo\n- copy `.env.template` to `src/main/resources/.env`\n\n\n\n## Build\n\n```shell\n./gradlew build\n```\n\n## Format/Lint \n\n```shell\n./gradlew lintKotlin # see lint errors\n./gradlew formatKotlin # attempt to automatically fix lint errors\n```\n\n## Run\n```shell\n./gradlew bootRun\n```\n\n## Test\n\n```shell\n./gradlew test\n```\n\n## Package / Dist\n\n```shell\n./gradlew jar\n\n# Run the dist\njava -jar ./build/libs/example-service-1.0.0.jar  \n```\n\n## Try It\n\nNavigate to [http://localhost:8080/api_explorer/index.html](http://localhost:8080/api_explorer/index.html)\n\n## Validate Example\n\n\n```shell\ncurl -X POST \"http://localhost:8080/users\" -H \"accept: application/json\" -H \"Content-Type: application/json\" -d \"{\\\"me\\\":\\\"carmine\\\"}\"\n\n{\n  \"error\": \" Object instance has properties which are not allowed by the schema: [\\\"me\\\"]\",\n  \"code\": 400\n}\n```\n## Interactive Api doc\n\n![](https://raw.githubusercontent.com/cdimascio/kotlin-spring-mvc-template/master/assets/swagger-ui.png)\n\n## License\nApache 2.0\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcdimascio%2Fkotlin-spring-mvc-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcdimascio%2Fkotlin-spring-mvc-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcdimascio%2Fkotlin-spring-mvc-template/lists"}