• Stars
    star
    122
  • Rank 281,888 (Top 6 %)
  • Language
    Go
  • License
    Apache License 2.0
  • Created almost 4 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

JSON schema generator for Caddy v2

caddy-json-schema

JSON schema generator for Caddy v2.

The generated schema can be integrated with editors for intellisense and better experience with configuration and plugin development.

Demonstration

Installation

The generated schema is for the caddy binary. i.e. all modules in the binary will be include in the schema.

xcaddy build v2.4.1 \
    --with github.com/abiosoft/caddy-json-schema \
    # any other module you want to include in the generated schema

Usage

Run caddy help json-schema to view help.

usage:
  caddy json-schema [--output <file>] [--indent <int>] [--vscode] [--no-cache]

flags:
  -indent int
        Number of spaces to indent the generated JSON with (default 2)
  -no-cache
        Discard local cache and fetch latest API docs
  -output string
        The file to write the generated schema (default "./caddy_schema.json")
  -vscode
        Generate VSCode configuration

Editors

Visual Studio Code

caddy json-schema --vscode generates Visual Studio Code configuration in the current directory.

Open the directory in Visual Studio Code and it should just work. Ensure the config filename is of the format *caddy*.[json|yaml].

Note that you need vscode-yaml plugin to get similar experience for YAML files.

Vim/NeoVim

There are multiple Vim/NeoVim plugins with language server and JSON schema support.

Below is a config for coc-json and coc-yaml. The path to schema file is relative to the config file being edited.

{
  "json.schemas": [
    {
      "fileMatch": ["*caddy*.json"],
      "url": "./caddy_schema.json"
    }
  ],
  "yaml.schemas": {
    ".vscode/caddy_schema.json": ["*caddy*.yaml", "*caddy*.yml"]
  }
}

Features

Modules Intellisense Documentation
Standard Supported Supported
Third Party Supported Supported (if plugin is registered on caddyserver.com)

License

Apache 2

More Repositories

1

colima

Container runtimes on macOS (and Linux) with minimal setup
Go
16,222
star
2

ishell

Library for creating interactive cli applications.
Go
1,536
star
3

caddy-docker

Docker container for Caddy
Shell
765
star
4

caddy-git

git middleware for Caddy
Go
207
star
5

dockward

Port forwarding tool for Docker containers
Go
136
star
6

caddy-exec

Caddy v2 module for running one-off commands
Go
91
star
7

DevReload

Auto reload for ASP.NET core development
C#
62
star
8

autoplank

automatically move Plank to the active monitor
Go
50
star
9

runcmd

Wrapper for cli apps. Write less commands.
Go
43
star
10

semaphore

Wrapping sync.Mutex for familiar semaphore api
Go
43
star
11

caddyplug

Experimental Caddy plugin manager using Go plugins
Go
40
star
12

river

River is a simple and lightweight REST server
Go
37
star
13

gocalc

Simple Go Calculator
Go
34
star
14

dotfiles

dotfiles. zsh, neovim, tmux, i3 e.t.c.
Vim Script
34
star
15

caddy-yaml

Alternative Caddy YAML config adapter with extra features
Go
26
star
16

crostini-docker

Docker for Crostini with fixed binariest that work
Shell
25
star
17

caddy-json-parse

Caddy v2 module for parsing json request
Go
16
star
18

parent

A minimal process wrapper
Go
15
star
19

caddy-named-routes

named routes support for Caddy v2
Go
12
star
20

lineprefix

io.Writer wrapper with line prefix and color customizations.
Go
11
star
21

launchar

minimal GTK application launcher
Vala
11
star
22

hello-elementary

quick start elementary OS application
Vala
10
star
23

caddy-hmac

Caddy v2 hmac signature validation middleware
Go
7
star
24

cmdplay

Prototype shell session recorder and player
Go
5
star
25

bgrun

Run processes in background
Python
5
star
26

hello-caddy

Sample external middleware for Caddy
Go
4
star
27

caddyserver.com

Source of the Caddy website
HTML
4
star
28

forloopui2017

Code used for forloop UI 2017 talk
Go
3
star
29

webtest

Basically web repo to test servers
HTML
3
star
30

atom-go-imports

Auto import Go packages via the goimports tool
CoffeeScript
3
star
31

errs

convenience wrapper for chaining multiple error returning functions.
Go
3
star
32

injekt

Pluggable service injector
Go
3
star
33

colima-core

Dependencies for Colima
Shell
3
star
34

hcl2json

HCL to JSON converter
Go
3
star
35

servefile

File Server for any directory or file
Go
2
star
36

buildsrv

The Caddy build server
Go
2
star
37

gistdl

Download github gists as files
Python
2
star
38

ghrelease

A tool to download latest release archive for a GitHub project using GitHub API.
Go
2
star
39

node-graceful

Gracefully shutdown your node app. Graceful interrupts SIGTERM and SIGINT signals.
JavaScript
2
star
40

codementorhannah

Mentorship codes
Go
1
star
41

lexicon

CSC 332 Assignment
JavaScript
1
star
42

gopages-sample

Sample blog using gopages and mgo
1
star
43

structures

CSC 341 assignment
Go
1
star
44

stack

Simple Stack
Go
1
star
45

goutils

A set of utilities for Go
Go
1
star