Bumping k8s dependencies to 1.13
This commit is contained in:
20
vendor/github.com/googleapis/gnostic/linters/node/gnostic-lint-operations/Makefile
generated
vendored
Normal file
20
vendor/github.com/googleapis/gnostic/linters/node/gnostic-lint-operations/Makefile
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
|
||||
GNOSTIC = $(GOPATH)/src/github.com/googleapis/gnostic
|
||||
|
||||
plugin:
|
||||
node_modules/.bin/pbjs -t json \
|
||||
$(GNOSTIC)/OpenAPIv2/OpenAPIv2.proto \
|
||||
$(GNOSTIC)/OpenAPIv3/OpenAPIv3.proto \
|
||||
$(GNOSTIC)/discovery/discovery.proto \
|
||||
$(GNOSTIC)/surface/surface.proto \
|
||||
$(GNOSTIC)/plugins/plugin.proto \
|
||||
> bundle.json
|
||||
node_modules/.bin/nexe gnostic-lint-operations.js
|
||||
|
||||
run: plugin
|
||||
gnostic $(GNOSTIC)/examples/v2.0/yaml/petstore.yaml --lint-operations
|
||||
|
||||
setup:
|
||||
npm install protobufjs
|
||||
npm install get-stdin
|
||||
npm install nexe
|
||||
15
vendor/github.com/googleapis/gnostic/linters/node/gnostic-lint-operations/README.md
generated
vendored
Normal file
15
vendor/github.com/googleapis/gnostic/linters/node/gnostic-lint-operations/README.md
generated
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
This directory contains a gnostic linter written with node.
|
||||
|
||||
It is built using [dcodeIO/Protobuf.js](https://github.com/dcodeIO/ProtoBuf.js).
|
||||
|
||||
### SETUP
|
||||
|
||||
- Install node.
|
||||
- Run `make setup` to install node dependencies.
|
||||
|
||||
### TRY IT
|
||||
|
||||
- Run `make run` to test-run the plugin.
|
||||
|
||||
|
||||
|
||||
47
vendor/github.com/googleapis/gnostic/linters/node/gnostic-lint-operations/gnostic-lint-operations.js
generated
vendored
Normal file
47
vendor/github.com/googleapis/gnostic/linters/node/gnostic-lint-operations/gnostic-lint-operations.js
generated
vendored
Normal file
@@ -0,0 +1,47 @@
|
||||
// import libraries
|
||||
const protobuf = require("protobufjs")
|
||||
const getStdin = require('get-stdin')
|
||||
|
||||
// import messages
|
||||
const root = protobuf.Root.fromJSON(require("./bundle.json"))
|
||||
const Request = root.lookupType("gnostic.plugin.v1.Request")
|
||||
const Response = root.lookupType("gnostic.plugin.v1.Response")
|
||||
const Document = root.lookupType("openapi.v2.Document")
|
||||
|
||||
getStdin.buffer().then(buffer => {
|
||||
const request = Request.decode(buffer)
|
||||
messages = []
|
||||
for (var j in request.models) {
|
||||
const m = request.models[j]
|
||||
if (m.type_url == "openapi.v2.Document") {
|
||||
const openapi2 = Document.decode(m.value)
|
||||
const paths = openapi2.paths.path
|
||||
for (var i in paths) {
|
||||
const path = paths[i]
|
||||
//console.error('path %s\n\n', path.name)
|
||||
const getOperation = path.value.get
|
||||
if (getOperation && getOperation.operationId == "") {
|
||||
messages.push({level:3, code:"NOOPERATIONID", text:"No operation id.", keys:["paths", path.name, "get"]})
|
||||
}
|
||||
const postOperation = path.value.post
|
||||
if (postOperation && postOperation.operationId == "") {
|
||||
messages.push({level:3, code:"NOOPERATIONID", text:"No operation id.", keys:["paths", path.name, "post"]})
|
||||
}
|
||||
//console.error('get %s\n\n', JSON.stringify(getOperation))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const payload = {
|
||||
messages: messages
|
||||
}
|
||||
|
||||
// Verify the payload if necessary (i.e. when possibly incomplete or invalid)
|
||||
const errMsg = Response.verify(payload)
|
||||
if (errMsg)
|
||||
throw Error(errMsg)
|
||||
|
||||
const message = Response.create(payload)
|
||||
process.stdout.write(Response.encode(message).finish())
|
||||
|
||||
}).catch(err => console.error(err))
|
||||
Reference in New Issue
Block a user