Ejemplo n.º 1
0
func (suite *ModelSuite) SetupSuite() {
	if initialisedParser == nil {
		initialisedParser = parser.NewParser()
		initialisedParser.ParseTypeDefinitions(ExamplePackageName)
	}
	suite.parser = initialisedParser
	suite.knownModelNames = make(map[string]bool)
}
Ejemplo n.º 2
0
func InitParser() *parser.Parser {
	parser := parser.NewParser()

	parser.BasePath = *basePath
	parser.IsController = IsController

	parser.TypesImplementingMarshalInterface["NullString"] = "string"
	parser.TypesImplementingMarshalInterface["NullInt64"] = "int"
	parser.TypesImplementingMarshalInterface["NullFloat64"] = "float"
	parser.TypesImplementingMarshalInterface["NullBool"] = "bool"

	return parser
}
Ejemplo n.º 3
0
func InitParser(controllerClass, ignore string) *parser.Parser {
	parser := parser.NewParser()

	parser.ControllerClass = controllerClass
	parser.IsController = IsController
	parser.Ignore = ignore

	parser.TypesImplementingMarshalInterface["NullString"] = "string"
	parser.TypesImplementingMarshalInterface["NullInt64"] = "int"
	parser.TypesImplementingMarshalInterface["NullFloat64"] = "float"
	parser.TypesImplementingMarshalInterface["NullBool"] = "bool"

	return parser
}
Ejemplo n.º 4
0
func (suite *ParserSuite) SetupSuite() {
	if initialisedParser2 == nil {
		initialisedParser2 = parser.NewParser()

		initialisedParser2.BasePath = exampleBasePath
		initialisedParser2.IsController = IsController

		gopath := os.Getenv("GOPATH")
		if gopath == "" {
			suite.T().Fatalf("Please, set $GOPATH environment variable\n")
		}

		initialisedParser2.ParseGeneralApiInfo(path.Join(gopath, "src", "github.com/yvasiyarov/swagger/example/web/main.go"))
		initialisedParser2.ParseApi("github.com/yvasiyarov/swagger/example")
	}
	suite.parser = initialisedParser2
}
Ejemplo n.º 5
0
func (suite *ApiDeclarationSuite) SetupSuite() {
	suite.parser = parser.NewParser()
	suite.operation = parser.NewOperation(suite.parser, "test")
	suite.operation2 = parser.NewOperation(suite.parser, "test")
	suite.operation3 = parser.NewOperation(suite.parser, "test")
}
Ejemplo n.º 6
0
func (suite *OperationSuite) SetupSuite() {
	suite.parser = parser.NewParser()
}