Skip to content

feat: add schema linting and validation with jsonschema#796

Open
meskill wants to merge 7 commits intopgdogdev:mainfrom
meskill:push-rslmxsxllmyl
Open

feat: add schema linting and validation with jsonschema#796
meskill wants to merge 7 commits intopgdogdev:mainfrom
meskill:push-rslmxsxllmyl

Conversation

@meskill
Copy link
Contributor

@meskill meskill commented Feb 27, 2026

Features

Fix #790 and prevent issues like this in the future.

Dev-experience when working with configuration files

If specific tools are used (like tombi or taplo) on the user side provide additional linting and documentation when working with pgdog config files.

image image image

Implementation

  • defines jsonschema on config types
  • add doc comments from the doc site that are embedded in the jsonschema and can be used by linting tools
  • add script crate that generates jsonschema and updates it in the .schema directory
  • adds ci that validates that schema is up-to-date and that example config files are valid against the schema

Next steps

  • publish the schema files on the jsonschema store to allow automatic discovery of relevant jsonschema files
    • for now the proper linting requires manual setup through the extension itself or embed the schema path in the file, but with published schema that could happen automatically based on the filename
    • to make it more relevant I suggest to rename users.toml default to something more pgdog specific to avoid confusion for automatic discovery for the jsonschema
  • update documentation site to suggest using mentioned tools to provide better user experience when working with configuration files

@codecov
Copy link

codecov bot commented Feb 27, 2026

Codecov Report

❌ Patch coverage is 14.28571% with 18 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
pgdog-config/src/users.rs 0.00% 10 Missing ⚠️
pgdog-config/src/core.rs 27.27% 8 Missing ⚠️

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

example.pgdog.toml has invalid configuration fields (obsolete?)

1 participant