JSON Parser ported from TypeScript to Kotlin 2.2.0, featuring a CLI application and a parser library.
- Java 24+
- Gradle (wrapper included)
# Unix/macOS
./gradlew build
# Windows
./gradlew.bat build
This project uses the org.jlleitschuh.gradle.ktlint
plugin, which is a Gradle wrapper that runs the ktlint
jar and integrates it into Gradle tasks.
# Unix/macOS
./gradlew ktlintCheck
# Windows
./gradlew.bat ktlintCheck
# Unix/macOS
./gradlew ktlintFormat
# Windows
./gradlew.bat ktlintFormat
# Unix/macOS
./gradlew test
# Windows
./gradlew.bat test
The json
module uses the Kover Gradle plugin to generate test coverage reports.
# Unix/macOS
./gradlew :json:koverHtmlReport
# Windows
./gradlew.bat :json:koverHtmlReport
The HTML report will be generated at json/build/reports/kover/html/index.html
.
# Unix/macOS
./gradlew :json:koverXmlReport
# Windows
./gradlew.bat :json:koverXmlReport
The XML report will be generated at json/build/reports/kover/report.xml
.
# Unix/macOS
./gradlew :app:run
# Windows
./gradlew.bat :app:run
The Ktor API server is located in the api-ktor
module.
To start the API server:
# Unix/macOS
./gradlew :api-ktor:run
# Windows
./gradlew.bat :api-ktor:run
By default, the server runs on http://localhost:8000.
The Spring Boot API server is located in the api-springboot
module.
To start the API server:
# Unix/macOS
./gradlew :api-springboot:run
# Windows
./gradlew.bat :api-springboot:run
By default, the server runs on http://localhost:8000.
The Vert.x API server is located in the api-vertx
module.
To start the API server:
# Unix/macOS
./gradlew :api-vertx:run
# Windows
./gradlew.bat :api-vertx:run
By default, the server runs on http://localhost:8000.
You can test the API endpoints using the REST Client extension for VS Code.
Sample HTTP request files are provided in the testdata/
directory (e.g., testdata/all.rest
, testdata/object.rest
, etc.).
To use:
- Install the REST Client extension in VS Code.
- Open any
.rest
file intestdata/
. - Click "Send Request" above the desired HTTP request to execute it against the running API server.
- The CLI entry point is in
app/src/main/kotlin/com/github/jsonkt/cli/App.kt
. - The parser library code is in
json/src/main/kotlin/com/github/jsonkt/shared/
.
This project is developed using Kotlin, and for the best development experience in VS Code, consider the upcoming official Kotlin VS Code extension and Language Server (LSP) from JetBrains (jetbrains.kotlin
).
For early access builds, check the Kotlin LSP releases on GitHub.
This project uses the Gradle Versions Plugin to help you discover dependency updates.
Run the following command in your project root:
# Unix/macOS
./gradlew dependencyUpdates
# Windows
./gradlew.bat dependencyUpdates
After running the command, a report will be generated at ./build/dependencyUpdates/report.txt
.
This file lists your current dependencies and any available updates.
For more details and configuration options, see the plugin documentation.