CLARIAH / grlc

grlc builds Web APIs using shared SPARQL queries
http://grlc.io
MIT License
135 stars 32 forks source link

Warning displaying due to JSON files not parsed properly #316

Closed vemonet closed 3 years ago

vemonet commented 3 years ago

Hi, I deployed a grlc OpenAPI alongside a React TypeScript app. See the repository here: http://grlc.io/api-git/vemonet/shapes-of-you it's a small project to index and expose SHACL/ShEx shapes, OWL/OBO ontologies, SKOS vocabularies and SPARQL queries, I reused some concepts, metadata and even code bits from grlc.io for the SPARQL part, thanks a lot!

The API works, but it takes some time to load and shows a few warning due to unvalid JSON (which are required for my typescript project). In this case package.json, tsconfig.json and app.json

You should be able to check it yourself here: http://grlc.io/api-git/vemonet/shapes-of-you

Would it be possible to disable the display of warning in case a JSON file is not parser properly? It is a relatively common file to have at the root of a repository :)

Screenshot from 2021-02-06 17-26-11

c-martinez commented 3 years ago

Hey @vemonet!

The reason JSON files are parsed is because queries can be expressed as JSON. You are right, this could be confusing for other standard files such as you mention.

As a work around, what you could do is have your queries on their own directory, for example:

https://grlc.io/api-git/c-martinez/shapes-of-you/subdir/queries

Would this work for you?

vemonet commented 3 years ago

Yes that works for my use-case, thanks for the suggestion, it is cleaner anyway as the API grows :)