Skip to content
This repository was archived by the owner on Apr 13, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly

- package-ecosystem: gomod
directory: /
schedule:
interval: weekly
21 changes: 21 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Test

on:
push:
pull_request:

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
go-version:
- "1.25"
- "1.26"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}
- run: go vet ./...
- run: go test ./...
9 changes: 0 additions & 9 deletions .travis.yml

This file was deleted.

7 changes: 7 additions & 0 deletions format_checkers.go
Original file line number Diff line number Diff line change
Expand Up @@ -257,12 +257,19 @@ func (f DateFormatChecker) IsFormat(input interface{}) bool {
}

// IsFormat checks if input correctly formatted time (HH:MM:SS or HH:MM:SSZ-07:00)
// per RFC3339, which does not allow comma as a decimal separator (unlike ISO 8601).
func (f TimeFormatChecker) IsFormat(input interface{}) bool {
asString, ok := input.(string)
if !ok {
return true
}

// RFC3339 does not permit comma as a fractional seconds separator (ISO 8601 does).
// Go's time.Parse accepts both, so we must reject commas explicitly.
if strings.ContainsRune(asString, ',') {
return false
}

if _, err := time.Parse("15:04:05Z07:00", asString); err == nil {
return true
}
Expand Down
8 changes: 6 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
module github.com/elastic/gojsonschema

go 1.16
go 1.25

require (
github.com/stretchr/testify v1.3.0
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415
)

require github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f // indirect
require (
github.com/davecgh/go-spew v1.1.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect
)
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f h1:J9EGpcZtP0E/raorCMxlFGSTBrsSlaDGf3jU/qvAE2c=
github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU=
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb h1:zGWFAtiMcyryUHoUjUJX0/lt1H2+i2Ka2n+D3DImSNo=
github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU=
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 h1:EzJWgHovont7NscjpAxXsDA8S8BMYve8Y5+7cuRE7R0=
github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415/go.mod h1:GwrjFmJcFw6At/Gs6z4yjiIwzuJ1/+UwLxMQDVQXShQ=
1 change: 1 addition & 0 deletions schemaLoader.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ func NewSchemaLoader() *SchemaLoader {
ps := &SchemaLoader{
pool: &schemaPool{
schemaPoolDocuments: make(map[string]*schemaPoolDocument),
jsonLoaderFactory: DefaultJSONLoaderFactory{},
},
AutoDetect: true,
Validate: false,
Expand Down
9 changes: 3 additions & 6 deletions schemaReferencePool.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@

package gojsonschema

import (
"fmt"
)

type schemaReferencePool struct {
documents map[string]*subSchema
Expand All @@ -44,12 +41,12 @@ func newSchemaReferencePool() *schemaReferencePool {
func (p *schemaReferencePool) Get(ref string) (r *subSchema, o bool) {

if internalLogEnabled {
internalLog(fmt.Sprintf("Schema Reference ( %s )", ref))
internalLog("Schema Reference ( %s )", ref)
}

if sch, ok := p.documents[ref]; ok {
if internalLogEnabled {
internalLog(fmt.Sprintf(" From pool"))
internalLog(" From pool")
}
return sch, true
}
Expand All @@ -60,7 +57,7 @@ func (p *schemaReferencePool) Get(ref string) (r *subSchema, o bool) {
func (p *schemaReferencePool) Add(ref string, sch *subSchema) {

if internalLogEnabled {
internalLog(fmt.Sprintf("Add Schema Reference %s to pool", ref))
internalLog("Add Schema Reference %s to pool", ref)
}
if _, ok := p.documents[ref]; !ok {
p.documents[ref] = sch
Expand Down
Loading