forked from loafle/openapi-generator-original
* fix schema/definition name as 'file' * update samples * Trigger CI due to previous Shippable race condition * add fix with toModelName(openAPIType) * update tests for file schema/definition name * Update 3.0 test spec * update samples * update samples for jaxrs-cxf * Trigger CI due to previous Shippable race condition * add back explode
30 lines
711 B
Go
30 lines
711 B
Go
package main
|
|
|
|
import (
|
|
"testing"
|
|
|
|
sw "./go-petstore"
|
|
"golang.org/x/net/context"
|
|
)
|
|
|
|
// TestPutBodyWithFileSchema ensures a model with the name 'File'
|
|
// gets converted properly to the petstore.File struct vs. *os.File
|
|
// as specified in typeMapping for 'File'.
|
|
func TestPutBodyWithFileSchema(t *testing.T) {
|
|
return // early return to test compilation
|
|
|
|
schema := sw.FileSchemaTestClass{
|
|
File: sw.File{SourceURI: "https://example.com/image.png"},
|
|
Files: []sw.File{{SourceURI: "https://example.com/image.png"}}}
|
|
|
|
r, err := client.FakeApi.TestBodyWithFileSchema(context.Background(), schema)
|
|
|
|
if err != nil {
|
|
t.Errorf("Error while adding pet")
|
|
t.Log(err)
|
|
}
|
|
if r.StatusCode != 200 {
|
|
t.Log(r)
|
|
}
|
|
}
|