publiccode-validator-api

command module
v1.0.3-0...-2b62c12 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 9, 2026 License: AGPL-3.0 Imports: 8 Imported by: 0

README

publiccode.yml RESTful validator API

Get invited

A RESTful API for validating publiccode.yml files, using the publiccode-parser-go library.

API reference

The OpenAPI spec is in publiccode-validator-api.oas.yaml.

Browse the interactive Swagger UI preview

Usage

go run main.go
Validate a publiccode.yml file
curl -X QUERY "http://localhost:3000/v1/validate" --data-binary "@./publiccode.yml"

or

curl -X QUERY "http://localhost:3000/v1/validate" \
--data-binary $'publiccodeYmlVersion: "0.5"\ndevelopmentStatus: stable\n [...]\n'
Example response (valid publiccode.yml)
{
  "valid": true,
  "results": []
}
Example response (with errors / warnings)
{
  "valid": false,
  "results": [
    {
      "type": "error",
      "key": "legal.license",
      "description": "license must be a valid license (see https://spdx.org/licenses)",
      "line": 12,
      "column": 5
    },
    {
      "type": "warning",
      "key": "publiccodeYmlVersion",
      "description": "v0.2 is not the latest version, use '0'. Parsing this file as v0.5",
      "line": 1,
      "column": 1
    }
  ]
}
Example error response

All error responses are returned using the application/problem+json media type, in accordance with RFC 9457.

HTTP/1.1 400 Bad Request
Content-Type: application/problem+json
{
  "title": "empty body",
  "detail": "need a body to validate",
  "status": 400
}

Contributing

Contributing is always appreciated, see CONTRIBUTING.md. Feel free to open issues, fork or submit a Pull Request.

Maintainers

This software is maintained by community maintainers.

License

© 2018-2020 Team per la Trasformazione Digitale - Presidenza del Consiglio dei Minstri

Licensed under AGPL-3.0. The version control system provides attribution for specific lines of code.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL