Comments (9)
Thanks @azeemba, you are correct, there's a bug. I fixed it with a72b1c0
from vscode-json-languageservice.
Sure, we can add a second validation API doValidate2
that requires a schema and is sync.
You want to give it a try and make a PR?
from vscode-json-languageservice.
I'll give it a go! Thanks - I just wanted to check something like that could be useful for this library.
from vscode-json-languageservice.
I have worked out a way to do what I want by using https://www.npmjs.com/package/synchronous-promise. This means that your library requires no changes to support my usecase because you already allow using a custom promise constructor.
I'm not going to close this issue, as a cleaner solution would be ideal, although I won't object if you wish to.
from vscode-json-languageservice.
I was looking into implementing this but I found something unexpected so wanted to clarify. It seems that getDiagnostics
can be either called with a JSONSchema or a ResolvedSchema.
Since the former doesn't have a .error
field, I am not sure how this line isn't erroring out.
Is this an issue? Or should the PR for this maintain this behavior?
from vscode-json-languageservice.
I did look into this and that was what stopped me contributing - I thought there was some really complex infrastructure in place to make that work...
from vscode-json-languageservice.
Is there still demand for this or plans to work on this?
from vscode-json-languageservice.
Yes, so my use case is the following:
We have a monaco editor in which we do JSON validation against a given schema and additionally we want to log the diagnostics somewhere. Since the monaco editor doesnโt support simply reading out the diagnostics, we are forced to actually validate the same string again with vscode-json-languageservice.
Since at that point the schema and json string are already given, I would wish there was a simple synchronous validate(json, schema)
and in my naive thinking this could be called by doValidation
internally?
from vscode-json-languageservice.
Hi, is there any capacity to look into this issue? If I could receive some guidance I could also try to implement this in a PR.
from vscode-json-languageservice.
Related Issues (20)
- Cannot resolve non-ascii url-encoded JSON schema url
- Autocompletion doesn't work with 2020-12 schema for sub levels
- Assigning $ref to a path that has a pound sign throws an error HOT 1
- Request textDocument/documentSymbol failed. - Cannot read properties of undefined (reading 'range')
- Make JSONSchemaService an API
- defaultSnippets not showing following v5.3.0 HOT 2
- Intellisense recommends invalid schema uris for JSON Schema drafts HOT 2
- Unexpected token after updating to 5.3.5 HOT 1
- Validation of uuid format not working
- doHover seems to use the unresolved schema
- Package exports are problematic HOT 2
- insertFinalNewline should default to true
- anyOf error messaging is broken
- code completion breaks when anyOf defines `required` properties. HOT 2
- Regression: Problems loading reference schemaservice
- How to: $ref to external schemas in VSC
- Intellisense is missing JSON Schema versions 2019-09, 2020-12 HOT 3
- Support `title` schema property in completion items
- JSON Schema meta-schemas should not be downloaded
- Validation of uri-reference format does not seem to work well
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vscode-json-languageservice.