casualjim on master
fixes #169 no pointing to inter… (compare)
casualjim on master
add drone yml build (compare)
casualjim on master
remove godep for gvt (compare)
casualjim on master
Add default value support for r… Merge pull request #173 from al… (compare)
casualjim on master
rebuilding site Tue Dec 15 09:5… (compare)
casualjim on master
rebuilding site Mon Dec 14 13:4… (compare)
restapi/operations/NAME_api.go
the file is just missing
'/_debug':
get:
tags: ['_debug']
operationId: 'getDebug'
summary: 'Debug route strictly for testing.'
responses:
'200':
description: 'Debug result.'
schema: { type: 'any' }
type Cat struct {}
). Is that expected?
If I'm understanding the swagger spec correctly, a path supporting a schema with a discriminator would support operations using any schema which inherits the top-level schema.
So, in the example above, a POST to /pets
that accepts schema of type Pet would also accept a post matching a Cat schema like { "petType": "Cat", "name":"Meow", "huntingSkill": "lazy" }
type iPet interface {}
type Pet struct { petName, name string }
type Cat struct { Pet, huntingLevel string }
type Dog struct { Pet, packSize int }
type AddPetParams struct {
// Pet to add to the store
Pet iPet
}
func (fn AddPetHandlerFunc) Handle(params AddPetParams) (*iPet, error) {
return fn(params)
}
// Actual handler
func addPet(params AddPetParams) (*iPet, error) {
switch params.Pet.(type) {
case Cat:
// handle cat
case Dog:
// handle Dog
case Pet:
// handle untyped Pet
default:
return nil, fmt.Errorf("not a known pet; this should be captured by validation?")
}
}
Schema error at paths['/example'].put
should be object
error and I can not seem to figure out what I'm doing wrong.paths:
/example:
# In this operation we do not apply the security, because it was applied globally above.
# The security will be applied to this operation for that reason.
get:
summary: Server example operation
description: This is an example opeartion to show how security is applied to the call.
responses:
200:
description: OK
put:
responses:
200:
description: My cool new method