Skip to content

Add configuration for devcontainers #79

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 17 commits into from
Mar 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"name": "KMP json schema validator",
"image": "mcr.microsoft.com/devcontainers/java:1.0-11",
"features": {
"ghcr.io/devcontainers/features/java:1" : {
"version": "11",
"installGradle": true,
"gradleVersion": "8.1"
},
"ghcr.io/devcontainers/features/python:1": {
"version": "3.10",
"installTools": false
},
"ghcr.io/rocker-org/devcontainer-features/apt-packages" : {
"packages": "tig"
},
"ghcr.io/devcontainers/features/sshd:1": {
"version": "latest"
}
},
// Download all required dependencies
"postCreateCommand": {
"install-dependencies": "./gradlew dependencies > /dev/null",
"init-submodules": "git submodule init && git submodule update",
"git-completion": "echo \"source /usr/share/bash-completion/completions/git\" >> ~/.bashrc"
},
"customizations": {
"vscode": {
"extensions": [
"fwcd.kotlin",
"redhat.java",
"github.vscode-github-actions",
"vscjava.vscode-gradle"
]
}
}
}
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "schema-test-suite"]
path = test-suites/schema-test-suite
url = git@github.com:json-schema-org/JSON-Schema-Test-Suite.git
url = https://github.com/json-schema-org/JSON-Schema-Test-Suite.git
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ This multiplatform library is an implementation of JSON schema that can validate
[JsonElement](https://github.com/Kotlin/kotlinx.serialization/blob/master/formats/json/commonMain/src/kotlinx/serialization/json/JsonElement.kt)
from [kotlinx.serialization-json](https://github.com/Kotlin/kotlinx.serialization/tree/master/formats/json) library.

[![Open in GitHub Codespaces](https://github.com/codespaces/badge.svg)](https://codespaces.new/OptimumCode/json-schema-validator)
[![Open in DevPod!](https://devpod.sh/assets/open-in-devpod.svg)](https://devpod.sh/open#https://github.com/OptimumCode/json-schema-validator)

## Usage

### Supported targets
Expand Down Expand Up @@ -133,7 +136,7 @@ val valid = schema.validate(elementToValidate, errors::add)
- [Draft 7](https://json-schema.org/specification-links.html#draft-7)
<details>
<summary>Supported keywords</summary>

- Core

| Keyword | Status |
Expand Down Expand Up @@ -340,9 +343,20 @@ You can see the results in the latest workflow execution.

## Developer notes

### Build process

The update to Kotlin 1.9.22 came with an issue for JS incremental compilation.
In case you see an error about main function that already bind please execute `clean` task.

### Devcontainer

Devcontainers is a cool feature. However, by default in Codespaces and DevPod you will use [VS Code](https://code.visualstudio.com/).
This is a good IDE but not for Kotlin, unfortunately.
The extension that is available for VS Code to support Kotlin works quite slow (when workspace is just started)
and sometimes does not work correctly with multiplatform definitions.
Because of that I higly recoment using JetBrains Gateway
(but it looks like the GitHub Codespace provider is not currently compatible with latest Gateway version).

## Future plans

- [x] Add `$schema` property validation (if not set the latest supported will be used)
Expand Down