storj/private/apigen
Ivan Fraixedes 48d7be7eab
private/apigen: Panic types defined in main package
The API generator was generating invalid code when types were defined in
a main package because the generated Go code was defining in import from
it.

This commit update the Go generator to panic with a explicit error
message if that situation happens.

The commit also add a new endpoint to the example with a named types
(i.e. no anonymous) to show that the Generator works fine with them.

Change-Id: Ieddd89c67048de50516f7ac7787d602660dc4a54
2023-09-26 14:04:33 +02:00
..
example private/apigen: Panic types defined in main package 2023-09-26 14:04:33 +02:00
common_test.go private/apigen: Make API base path configurable 2023-08-28 14:35:01 +00:00
common.go private/apigen: Generate valid TypeScript code with anonymous types 2023-09-26 14:04:33 +02:00
docgen.go private/apigen: Make API base path configurable 2023-08-28 14:35:01 +00:00
endpoint.go private/apigen: Generate valid TypeScript code with anonymous types 2023-09-26 14:04:33 +02:00
gogen_test.go private/apigen: Panic types defined in main package 2023-09-26 14:04:33 +02:00
gogen.go private/apigen: Panic types defined in main package 2023-09-26 14:04:33 +02:00
tsgen.go private/apigen: Remove TypeScript errors from generated code 2023-09-26 14:04:33 +02:00
tstypes_test.go private/apigen: Generate valid TypeScript code with anonymous types 2023-09-26 14:04:33 +02:00
tstypes.go private/apigen: Generate valid TypeScript code with anonymous types 2023-09-26 14:04:33 +02:00