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 for create Command #750

Open
nifrhue opened this issue Dec 5, 2023 · 0 comments
Open

JSON-schema for create Command #750

nifrhue opened this issue Dec 5, 2023 · 0 comments
Assignees

Comments

@nifrhue
Copy link

nifrhue commented Dec 5, 2023

Hello pdfcpu maintainers,

I've identified a potential enhancement that I believe could significantly benefit the wider pdfcpu community.

Feature Request:
I propose the introduction of a JSON Schema for the JSON input files used in the create command. This schema would define the structure, constraints, and types of data expected in the JSON files. For more information about JSON Schemas, please refer to json-schema.org.

Benefits:

  1. Validation: A JSON Schema would enable developers to validate their JSON files against the expected format, reducing errors and streamlining the development process.
  2. Clarity and Documentation: It would serve as both documentation and a guide for new users, clarifying the structure required for JSON input.
  3. Development Efficiency: A clear schema simplifies the development and maintenance of scripts or applications that generate JSON inputs for pdfcpu.

Example Schema:
Below is a simple example of what a JSON Schema for a pdfcpu input might look like:

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "PDFCPU Input",
  "type": "object",
  "properties": {
    "title": {
      "type": "string"
    },
    "author": {
      "type": "string"
    },
    "content": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "text": { "type": "string" },
          "fontSize": { "type": "integer" },
          "color": { "type": "string" }
        },
        "required": ["text"]
      }
    }
  },
  "required": ["title", "content"]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants