Example #1
0
func (suite *ModelSuite) SetupSuite() {
	if initialisedParser == nil {
		initialisedParser = parser.NewParser()
		initialisedParser.ParseTypeDefinitions(ExamplePackageName)
	}
	suite.parser = initialisedParser
	suite.knownModelNames = make(map[string]bool)
}
Example #2
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
}
Example #3
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
}
Example #4
0
func (suite *OperationSuite) SetupSuite() {
	suite.parser = parser.NewParser()
}
Example #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")
}