Skip to content

Commit

Permalink
XIVY-13178 wip: map ivy.yaml to locally served schemas
Browse files Browse the repository at this point in the history
  • Loading branch information
ivy-rew committed Feb 26, 2024
1 parent 21dda59 commit 14fa26d
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
4 changes: 2 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
<script type="module" src="index.js"></script>
<script>
function loadEditor(content, theme) {
window.codeEditor = window.yamlEditor.create(document.getElementById('editor'), 'a://b/ivy.yaml', content, theme);
window.codeEditor = window.yamlEditor.create(document.getElementById('editor'), 'a://ivy/11.3.9/ivy.yaml', content, theme);
}

let content = `# yaml-language-server: $schema=https://json-schema.axonivy.com/ivy/11.3.1/ivy.json
let content = `# yaml-language-server: $schema=https://json-schema.axonivy.com/ivy/11.3.9/ivy.json
SecuritySystems:
azure:
`
Expand Down
20 changes: 19 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,25 @@ window.MonacoEnvironment = {
}

configureMonacoYaml(monaco, {
enableSchemaRequest: true
enableSchemaRequest: true,
schemas: [
{
// If YAML file is opened matching this glob
fileMatch: ['**/ivy.yaml'],
// Then this schema will be downloaded from the internet and used.
//uri: 'https://json-schema.ivyteam.ch/ivy/11.3.9/ivy.json'
//uri: 'http://127.0.0.1:8080/system/json-schema/ivy/11.3.9/ivy.json'
uri: 'http://localhost:5173/ivy/11.3.9/ivy.json'
},
// {
// // If YAML file is opened matching this glob
// fileMatch: ['**/app.yaml'],
// // Then this schema will be downloaded from the internet and used.
// //uri: 'https://json-schema.ivyteam.ch/ivy/11.3.9/ivy.json'
// //uri: 'http://127.0.0.1:8080/system/json-schema/ivy/11.3.9/ivy.json'
// uri: '/app/11.3.0/app.json'
// }
]
})

window.yamlEditor = {
Expand Down

0 comments on commit 14fa26d

Please sign in to comment.