Skip to content
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

XIVY-13178 wip: map ivy.yaml to locally served schemas #60

Open
wants to merge 1 commit into
base: stale/master
Choose a base branch
from
Open
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
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
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ivy.yaml editing with self-served schemas works well if no #yaml-language-server hint is set.
but we have it in all our models; for versioning reasons ... and as soon as we have an explicit schema defined, it will win over the predefined local model. :-(

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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'
},
Comment on lines +24 to +32
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

uri: can't be relative ... looks like an error in monaco-yaml fetching code ... fails at runtime

// {
// // 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