abiosoft / caddy-json-schema Goto Github PK
View Code? Open in Web Editor NEWJSON schema generator for Caddy v2
License: Apache License 2.0
JSON schema generator for Caddy v2
License: Apache License 2.0
Hey,
go: 1.17.2
caddy: 2.4.5
$ xcaddy build v2.4.5 --with github.com/abiosoft/caddy-json-schema
$ ./caddy json-schema -no-cache
json-schema discarding cache for root config.
json-schema fetching https://caddyserver.com/api/docs/config/ ...
json-schema
json-schema discarding cache for apps/exec.
json-schema fetching https://caddyserver.com/api/docs/config/apps/exec ...
json-schema
json-schema discarding cache for apps/supervisor.
json-schema fetching https://caddyserver.com/api/docs/config/apps/supervisor ...
json-schema
json-schema discarding cache for apps/http.
json-schema fetching https://caddyserver.com/api/docs/config/apps/http ...
json-schema
json-schema discarding cache for apps/pki.
json-schema fetching https://caddyserver.com/api/docs/config/apps/pki ...
json-schema
json-schema discarding cache for apps/tls.
json-schema fetching https://caddyserver.com/api/docs/config/apps/tls ...
json-schema
json-schema discarding cache for apps/auth.
json-schema fetching https://caddyserver.com/api/docs/config/apps/auth ...
json-schema
json-schema: unexpected end of JSON input
The url https://caddyserver.com/api/docs/config/apps/auth
response is empty with 502 error code.
Might not be a good idea to use the web server from caddy itself, it's an external services which can always change.
Like in my case it looks like auth is gone?
Running the instructed commands
xcaddy build v2.0.0 \
--with github.com/abiosoft/caddy-json-schema
./caddy json-schema -vscode
results in a panic
panic: qtls.ClientSessionState not compatible with tls.ClientSessionState
goroutine 1 [running]:
github.com/lucas-clemente/quic-go/internal/handshake.init.2()
github.com/lucas-clemente/[email protected]/internal/handshake/unsafe.go:26 +0x205
I'm compiling Caddy 2.2.1 with xcaddy using Go 1.14.4 on Ubuntu 20.04.1 LTS
xcaddy build \
--with github.com/abiosoft/caddy-json-schema \
--with github.com/caddy-dns/cloudflare
Caddy builds and runs fine, executing caddy json-schema --vscode
gives me this message
panic: reflect: call of reflect.Value.Type on zero Value
goroutine 1 [running]:
reflect.Value.Type(0x0, 0x0, 0x0, 0xc0006d7130, 0xc00073ee78)
reflect/value.go:1872 +0x183
github.com/abiosoft/caddy-json-schema.(*Interface).populate(0xc0008750e0, 0x0, 0x0)
github.com/abiosoft/[email protected]/interface.go:143 +0xef
github.com/abiosoft/caddy-json-schema.(*Interface).populate(0xc000875050, 0x148df40, 0xc0005c5860)
github.com/abiosoft/[email protected]/interface.go:132 +0x38e
github.com/abiosoft/caddy-json-schema.(*Interface).populateStruct(0xc000874e10, 0x1a7a5a0, 0x15fbd00)
github.com/abiosoft/[email protected]/interface.go:186 +0xd4a
github.com/abiosoft/caddy-json-schema.(*Interface).populate(0xc000874e10, 0x15fbd00, 0xc0005305c0)
github.com/abiosoft/[email protected]/interface.go:120 +0x2ac
github.com/abiosoft/caddy-json-schema.(*Interface).populate(0xc000874d80, 0x1488a80, 0xc0005c5840)
github.com/abiosoft/[email protected]/interface.go:132 +0x38e
github.com/abiosoft/caddy-json-schema.(*Interface).populateStruct(0xc00073fc88, 0x1a7a5a0, 0x1634e60)
github.com/abiosoft/[email protected]/interface.go:186 +0xd4a
github.com/abiosoft/caddy-json-schema.(*Interface).populate(0xc00073fc88, 0x1634e60, 0xc0004142a0)
github.com/abiosoft/[email protected]/interface.go:120 +0x2ac
github.com/abiosoft/caddy-json-schema.(*Interface).populate(0xc00073fc88, 0x15a28c0, 0xc000115bc0)
github.com/abiosoft/[email protected]/interface.go:124 +0x14e
github.com/abiosoft/caddy-json-schema.generateSchema(0x0, 0x0)
github.com/abiosoft/[email protected]/schema_util.go:51 +0x159
github.com/abiosoft/caddy-json-schema.run(0xc000115a40, 0xc00003a1a0, 0x1, 0x1)
github.com/abiosoft/[email protected]/command.go:67 +0x3d
github.com/caddyserver/caddy/v2/cmd.Main()
github.com/caddyserver/caddy/[email protected]/cmd/main.go:85 +0x239
main.main()
caddy/main.go:13 +0x20
caddy.logging.encoders.filter
's field
key should take (according to the docs and practice) an object of field names to filters. However, when using the schema generated by this plugin it says fields
should take an array and thus gives an error.
Caddy version v2.4.3
Caddy full donwload URL with plugins.
Example correct logging section which gives a type error (for common_log
) in vscode:
logging:
logs:
default:
exclude:
- http.log.access.stephie
stephie:
writer:
filename: /srv/popple/log/access.log
output: file
encoder:
fields:
common_log:
filter: delete
format: filter
wrap:
format: json
level_key: severity
message_key: message
time_key: timestampSeconds
level: DEBUG
include:
- http.log.access.stephie
GO111MODULE=off go get -u -v github.com/abiosoft/caddy-json-schema
github.com/smallstep/cli/usage
# github.com/smallstep/cli/usage
golang/src/github.com/smallstep/cli/usage/help.go:28:18: cannot use cli.StringFlag literal (type cli.StringFlag) as type cli.Flag in slice literal:
cli.StringFlag does not implement cli.Flag (Apply method has pointer receiver)
golang/src/github.com/smallstep/cli/usage/help.go:32:18: cannot use cli.StringFlag literal (type cli.StringFlag) as type cli.Flag in slice literal:
cli.StringFlag does not implement cli.Flag (Apply method has pointer receiver)
golang/src/github.com/smallstep/cli/usage/help.go:36:18: cannot use cli.StringFlag literal (type cli.StringFlag) as type cli.Flag in slice literal:
cli.StringFlag does not implement cli.Flag (Apply method has pointer receiver)
golang/src/github.com/smallstep/cli/usage/help.go:40:16: cannot use cli.BoolFlag literal (type cli.BoolFlag) as type cli.Flag in slice literal:
cli.BoolFlag does not implement cli.Flag (Apply method has pointer receiver)
golang/src/github.com/smallstep/cli/usage/help.go:44:16: cannot use cli.BoolFlag literal (type cli.BoolFlag) as type cli.Flag in slice literal:
cli.BoolFlag does not implement cli.Flag (Apply method has pointer receiver)
golang/src/github.com/smallstep/cli/usage/help.go:68:14: invalid argument args (type cli.Args) for len
golang/src/github.com/smallstep/cli/usage/help.go:73:28: cannot slice args (type cli.Args)
golang/src/github.com/smallstep/cli/usage/help.go:76:13: cannot use cmd (type *cli.Command) as type cli.Command in assignment
golang/src/github.com/smallstep/cli/usage/help.go:85:71: cannot use args (type cli.Args) as type []string in argument to strings.Join
golang/src/github.com/smallstep/cli/usage/help.go:86:79: cannot slice args (type cli.Args)
golang/src/github.com/smallstep/cli/usage/help.go:86:79: too many errors
Any hints for Emacs support of caddy-json-schema
?
Regards,
HZ
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.