Skip to content

Commit

Permalink
🐛 Make sure version in json schema version pining example is the latest
Browse files Browse the repository at this point in the history
  • Loading branch information
gwennlbh committed Apr 16, 2024
1 parent 8d5126a commit d2a300a
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
10 changes: 10 additions & 0 deletions db/json-schemas.data.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { getGoVersion } from "./client-libraries-versions"

export default {
watch: ["ortfodb/meta.go"],
async load(watchedFiles) {
return {
version: await getGoVersion(watchedFiles[0]),
}
},
}
12 changes: 11 additions & 1 deletion db/json-schemas.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
<script setup>
import { onMounted } from 'vue'
import { getGoVersion } from './client-libraries-versions.js'
import { data } from './json-schemas.data.js'
let version = data.version
onMounted(async () => {
version = await getGoVersion().catch(() => "v1.2.0")
})
</script>

# JSON Schemas

ortfo/db exports [JSON Schemas](https://json-schema.org/) for the different data files it uses.
Expand Down Expand Up @@ -37,7 +47,7 @@ The schemas are all available on ortfo/db's repository in the `schemas/` directo
Instead of getting the latest version, you can get a specific version by specifying it in the URL before the file name:

<center style="margin-bottom: 2em">
<span style="color: gray">https://</span>ortfo.org/<strong><span style="color: var(--vp-c-brand-1)">v1.2.0</span></strong>/<em>resource name</em>.schema.json
<span style="color: gray">https://</span>ortfo.org/<strong><span style="color: var(--vp-c-brand-1)">{{ version }}</span></strong>/<em>resource name</em>.schema.json
</center>

## Using it in your editor
Expand Down

0 comments on commit d2a300a

Please sign in to comment.