Codebase list golang-github-go-openapi-jsonreference / bfc8552
New upstream version 0.19.6 Guillem Jover 2 years ago
10 changed file(s) with 123 addition(s) and 53 deletion(s). Raw diff Collapse all Expand all
+0
-1
.drone.sec less more
0 eyJhbGciOiJSU0EtT0FFUCIsImVuYyI6IkExMjhHQ00ifQ.Xe40Wx6g5Y-iN0JVMhKyFfubtOId3zAVE564szw_yYGzFNhc_cGZO9F3BtAcJ55CfHG9C_ozn9dpnUDl_zYZoy_6cPCq13Ekb95z8NAC3ekDtbAATsc9HZwRNwI7UfkhstdwxljEouGB01qoLcUn6lFutrou-Ho21COHeDb2caemnPSA-rEAnXkOiBFu0RQ1MIwMygzvHXIHHYNpNwAtXqmiggM10miSjqBM3JmRPxCi7VK6_Rxij5p6LlhmK1BDi8Y6oBh-9BX3--5GAJeWZ6Vof5TnP-Enioia18j8c8KFtfY4q0y6Ednjb-AarLZ12gj695ppkBNJUdTJQmwGwA.fVcz_RiLrUB5fgMS.rjWllDYC6m_NB-ket_LizNEy9mlJ27odBTZQcMKaUqqXZBtWUCmPrOoMXGq-_cc-c7chg7D-WMh9SPQ23pV0P-DY-jsDpbOqHG2STOMEfW9ZREoaOLJXQaWcuBldLjRyWFcq0HGj97LgE6szD1Zlou3bmdHS_Q-U9Up9YQ_8_YnDcESD_cj1w5FZom7HjchKJFeGjQjfDQpoCKCQNMJaavUqy9jHQEeQ_uVocSrETg3GpewDcUF2tuv8uGq7ZZWu7Vl8zmnY1MFTynaGBWzTCSRmCkAXjcsaUheDP_NT5D7k-xUS6LwtqEUiXAXV07SNFraorFj5lnBQZRDlZMYcA3NWR6zHiOxekR9LBYPofst6w1rIqUchj_5m1tDpVTBMPir1eAaFcnJtPgo4ch17OF-kmcmQGLhJI3U7n8wv4sTrmP1dewtRRKrvlJe5r3_6eDiK4xZ8K0rnK1D4g6zuQqU1gA8KaU7pmZkKpFx3Bew4v-6DH32YwQBvAI7Lbb8afou9WsCNB_iswz5XGimP4bifiJRwpWBEz9VGhZFdiw-hZpYWgbxzVb5gtqfTDLIvpbLDmFz1vge16uUQHHVFpo1pSozyr7A60X8qsh9pmmO3RcJ-ZGZBWqiRC-Kl5ejz7WQ.LFoK4Ibi11B2lWQ5WcPSag
+0
-33
.drone.yml less more
0 clone:
1 path: github.com/go-openapi/jsonreference
2
3 matrix:
4 GO_VERSION:
5 - "1.6"
6
7 build:
8 integration:
9 image: golang:$$GO_VERSION
10 pull: true
11 commands:
12 - go get -u github.com/stretchr/testify/assert
13 - go get -u github.com/PuerkitoBio/purell
14 - go get -u github.com/go-openapi/jsonpointer
15 - go test -race
16 - go test -v -cover -coverprofile=coverage.out -covermode=count ./...
17
18 notify:
19 slack:
20 channel: bots
21 webhook_url: $$SLACK_URL
22 username: drone
23
24 publish:
25 coverage:
26 server: https://coverage.vmware.run
27 token: $$GITHUB_TOKEN
28 # threshold: 70
29 # must_increase: true
30 when:
31 matrix:
32 GO_VERSION: "1.6"
0 secrets.yml
0 linters-settings:
1 govet:
2 check-shadowing: true
3 golint:
4 min-confidence: 0
5 gocyclo:
6 min-complexity: 30
7 maligned:
8 suggest-new: true
9 dupl:
10 threshold: 100
11 goconst:
12 min-len: 2
13 min-occurrences: 4
14 linters:
15 enable-all: true
16 disable:
17 - maligned
18 - lll
19 - gochecknoglobals
20 - godox
21 - gocognit
22 - whitespace
23 - wsl
24 - funlen
25 - gochecknoglobals
26 - gochecknoinits
27 - scopelint
28 - wrapcheck
29 - exhaustivestruct
30 - exhaustive
31 - nlreturn
32 - testpackage
33 - gci
34 - gofumpt
35 - goerr113
36 - gomnd
37 - tparallel
38 - nestif
39 - godot
40 - errorlint
+0
-13
.pullapprove.yml less more
0 approve_by_comment: true
1 approve_regex: '^(:shipit:|:\+1:|\+1|LGTM|lgtm|Approved)'
2 reject_regex: ^[Rr]ejected
3 reset_on_push: false
4 reviewers:
5 members:
6 - casualjim
7 - chancez
8 - frapposelli
9 - vburenin
10 - pytlesk4
11 name: pullapprove
12 required: 1
0 after_success:
1 - bash <(curl -s https://codecov.io/bash)
2 go:
3 - 1.14.x
4 - 1.x
5 install:
6 - go get gotest.tools/gotestsum
7 jobs:
8 include:
9 # include linting job, but only for latest go version and amd64 arch
10 - go: 1.x
11 arch: amd64
12 install:
13 go get github.com/golangci/golangci-lint/cmd/golangci-lint
14 script:
15 - golangci-lint run --new-from-rev master
16 env:
17 - GO111MODULE=on
18 language: go
19 notifications:
20 slack:
21 secure: OpQG/36F7DSF00HLm9WZMhyqFCYYyYTsVDObW226cWiR8PWYiNfLZiSEvIzT1Gx4dDjhigKTIqcLhG34CkL5iNXDjm9Yyo2RYhQPlK8NErNqUEXuBqn4RqYHW48VGhEhOyDd4Ei0E2FN5ZbgpvHgtpkdZ6XDi64r3Ac89isP9aPHXQTuv2Jog6b4/OKKiUTftLcTIst0p4Cp3gqOJWf1wnoj+IadWiECNVQT6zb47IYjtyw6+uV8iUjTzdKcRB6Zc6b4Dq7JAg1Zd7Jfxkql3hlKp4PNlRf9Cy7y5iA3G7MLyg3FcPX5z2kmcyPt2jOTRMBWUJ5zIQpOxizAcN8WsT3WWBL5KbuYK6k0PzujrIDLqdxGpNmjkkMfDBT9cKmZpm2FdW+oZgPFJP+oKmAo4u4KJz/vjiPTXgQlN5bmrLuRMCp+AwC5wkIohTqWZVPE2TK6ZSnMYcg/W39s+RP/9mJoyryAvPSpBOLTI+biCgaUCTOAZxNTWpMFc3tPYntc41WWkdKcooZ9JA5DwfcaVFyTGQ3YXz+HvX6G1z/gW0Q/A4dBi9mj2iE1xm7tRTT+4VQ2AXFvSEI1HJpfPgYnwAtwOD1v3Qm2EUHk9sCdtEDR4wVGEPIVn44GnwFMnGKx9JWppMPYwFu3SVDdHt+E+LOlhZUply11Aa+IVrT2KUQ=
22 script:
23 - gotestsum -f short-verbose -- -race -coverprofile=coverage.txt -covermode=atomic ./...
0 # gojsonreference [![Build Status](https://ci.vmware.run/api/badges/go-openapi/jsonreference/status.svg)](https://ci.vmware.run/go-openapi/jsonreference) [![Coverage](https://coverage.vmware.run/badges/go-openapi/jsonreference/coverage.svg)](https://coverage.vmware.run/go-openapi/jsonreference) [![Slack Status](https://slackin.goswagger.io/badge.svg)](https://slackin.goswagger.io)
0 # gojsonreference [![Build Status](https://travis-ci.org/go-openapi/jsonreference.svg?branch=master)](https://travis-ci.org/go-openapi/jsonreference) [![codecov](https://codecov.io/gh/go-openapi/jsonreference/branch/master/graph/badge.svg)](https://codecov.io/gh/go-openapi/jsonreference) [![Slack Status](https://slackin.goswagger.io/badge.svg)](https://slackin.goswagger.io)
11
22 [![license](http://img.shields.io/badge/license-Apache%20v2-orange.svg)](https://raw.githubusercontent.com/go-openapi/jsonreference/master/LICENSE) [![GoDoc](https://godoc.org/github.com/go-openapi/jsonreference?status.svg)](http://godoc.org/github.com/go-openapi/jsonreference)
33 An implementation of JSON Reference - Go language
44
55 ## Status
6 Work in progress ( 90% done )
6 Feature complete. Stable API
77
88 ## Dependencies
9 https://github.com/xeipuuv/gojsonpointer
9 https://github.com/go-openapi/jsonpointer
1010
1111 ## References
1212 http://tools.ietf.org/html/draft-ietf-appsawg-json-pointer-07
0 module github.com/go-openapi/jsonreference
1
2 require (
3 github.com/PuerkitoBio/purell v1.1.1
4 github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 // indirect
5 github.com/go-openapi/jsonpointer v0.19.3
6 github.com/stretchr/testify v1.3.0
7 golang.org/x/net v0.0.0-20210421230115-4e50805a0758 // indirect
8 )
9
10 go 1.13
0 github.com/PuerkitoBio/purell v1.1.1 h1:WEQqlqaGbrPkxLJWfBwQmfEAE1Z7ONdDLqrN38tNFfI=
1 github.com/PuerkitoBio/purell v1.1.1/go.mod h1:c11w/QuzBsJSee3cPx9rAFu61PvFxuPbtSwDGJws/X0=
2 github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578 h1:d+Bc7a5rLufV/sSk/8dngufqelfh6jnri85riMAaF/M=
3 github.com/PuerkitoBio/urlesc v0.0.0-20170810143723-de5bf2ad4578/go.mod h1:uGdkoq3SwY9Y+13GIhn11/XLaGBb4BfwItxLd5jeuXE=
4 github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
5 github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
6 github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
7 github.com/go-openapi/jsonpointer v0.19.3 h1:gihV7YNZK1iK6Tgwwsxo2rJbD1GTbdm72325Bq8FI3w=
8 github.com/go-openapi/jsonpointer v0.19.3/go.mod h1:Pl9vOtqEWErmShwVjC8pYs9cog34VGT37dQOVbmoatg=
9 github.com/go-openapi/swag v0.19.5 h1:lTz6Ys4CmqqCQmZPBlbQENR1/GucA2bzYTE12Pw4tFY=
10 github.com/go-openapi/swag v0.19.5/go.mod h1:POnQmlKehdgb5mhVOsnJFsivZCEZ/vjK9gh66Z9tfKk=
11 github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
12 github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
13 github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
14 github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
15 github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
16 github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
17 github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e h1:hB2xlXdHp/pmPZq0y3QnmWAArdw9PqbmotexnWx/FU8=
18 github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
19 github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
20 github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
21 github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
22 github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q=
23 github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
24 golang.org/x/net v0.0.0-20210421230115-4e50805a0758 h1:aEpZnXcAmXkd6AvLb2OPt+EN1Zu/8Ne3pCqPjja5PXY=
25 golang.org/x/net v0.0.0-20210421230115-4e50805a0758/go.mod h1:72T/g9IO56b78aLF+1Kcs5dz7/ng1VjMUvfKvpfy+jM=
26 golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
27 golang.org/x/sys v0.0.0-20210420072515-93ed5bcd2bfe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
28 golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
29 golang.org/x/text v0.3.6 h1:aRYxNxv6iGQlyVaZmk6ZgYEDa+Jg18DxebPSrd6bg1M=
30 golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
31 golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
32 gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
33 gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY=
34 gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
35 gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw=
36 gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
4646 }))
4747 }
4848
49 // nolint: dupl
4950 func TestFull(t *testing.T) {
5051
5152 in := "http://host/path/a/b/c#/f/a/b"
8081 }
8182 }
8283
84 // nolint: dupl
8385 func TestFullURL(t *testing.T) {
8486
8587 in := "http://host/path/a/b/c"
155157 assert.Equal(t, r3.String(), in[1:])
156158 }
157159
160 // nolint: dupl
158161 func TestURLPathOnly(t *testing.T) {
159162
160163 in := "/documents/document.json"
189192 }
190193 }
191194
195 // nolint: dupl
192196 func TestURLRelativePathOnly(t *testing.T) {
193197
194198 in := "document.json"
307311 }
308312
309313 if r1.IsCanonical() != true {
310 t.Errorf("New(%v)::IsCanonical %v expect %v", in1, r1.IsCanonical, true)
314 t.Errorf("New(%v)::IsCanonical %v expect %v", in1, r1.IsCanonical(), true)
311315 }
312316
313317 result, err := r1.Inherits(r2)
392396 "g#s/../x", "http://a/b/c/g#s/../x",
393397
394398 "http:g", "http:g", // for strict parsers
395 //"http:g", "http://a/b/c/g", // for backward compatibility
399 // "http:g", "http://a/b/c/g", // for backward compatibility
396400
397401 }
398402 for i := 0; i < len(checks); i += 2 {
399403 child := checks[i]
400404 expected := checks[i+1]
401 // fmt.Printf("%d: %v -> %v\n", i/2, child, expected)
402405
403406 childRef, e := New(child)
404407 if e != nil {