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

JSON Schema has invalid references that do not resolve #241

Open
dxh9845 opened this issue Dec 11, 2023 · 1 comment
Open

JSON Schema has invalid references that do not resolve #241

dxh9845 opened this issue Dec 11, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@dxh9845
Copy link

dxh9845 commented Dec 11, 2023

Summary

The JSON schema provided contains references that do not load / resolve. This prevents users from writing schemas with help from JSON / YAML language servers to provide inline-hinting for the schema.

Steps to reproduce

  1. Use VSCode or any other JSON schema compatible editor and write a YAML file with an inline schema definition to the JSON schema:
# yaml-language-server: $schema=https://raw.githubusercontent.com/OpenSLO/OpenSLO/main/schemas/v1/openslo.schema.json
---
apiVersion: openslo/v1
kind: SLO
metadata:
  name: "cps-api-healthy-requests"
spec:
  service: 
  
  1. View the VSCode problems section to see the that the schema cannot be loaded from the openslo.com hostname:
Problems loading reference 'https://openslo.com/schemas/v1/parts/slo-spec.schema.json': Unable to load schema from 'https://openslo.com/schemas/v1/parts/slo-spec.schema.json': Request vscode/content failed unexpectedly without providing any details.

What is the current bug behavior?

The OpenSLO schema files are invalid as written and contain refs to subschemas that do not load.

What is the expected correct behavior?

Users should be able to reference the OpenSLO schema and have the references resolve inline such that any valid YAML or JSON Language Server can provide hints on the shape of the OpenSLO schemas.

Relevant logs and/or screenshots

Problems loading reference 'https://openslo.com/schemas/v1/parts/slo-spec.schema.json': Unable to load schema from 'https://openslo.com/schemas/v1/parts/slo-spec.schema.json': Request vscode/content failed unexpectedly without providing any details.
image

OpenSLO schema references are not loadable:

Possible fixes

Not sure where it is held, but the OpenSLO Github Pages website does not properly resolve the schemas.

@dxh9845 dxh9845 added the bug Something isn't working label Dec 11, 2023
@nieomylnieja
Copy link
Member

nieomylnieja commented Jan 10, 2024

hey @dxh9845, while we've had a contribution for JSON Schema some time ago, which was more of a POC then a lasting solution. It wasn't maintained since then nor was was it properly finished (afaik).
There's an ongoing discussion on how we want to define OpenSLO manifest source of truth.
Currently there's been 3 proposals:

Once we sort this out, we'll definitely want to have some kind of working JSON Schema for sure.
On the upcoming community meeting we'll want to decide on one of these approaches. I'll keep you posted once we've got an exact date If you'd be interested.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants