-
Notifications
You must be signed in to change notification settings - Fork 6k
Description
Description
I'm getting different generated servercode from http://editor.swagger.io and http://generator.swagger.io
The first will generate classes that inherit when using allOf, http://generator.swagger.io won't.
Swagger-codegen version
2.2.2
Swagger declaration file content or url
https://gist.github.com/albert-visser/498345f062b64026941d0c7c3d81d7ac
Steps to reproduce
Using http://editor.swagger.io
- Goto http://editor.swagger.io
- File --> import json --> content of gist
- Generate server -> aspnetcore or spring
Result: zip file with an event class
Spring: public class Event extends EventPost {
Aspnetcore: public partial class Event : EventPost, IEquatable<Event>
Using http://generator.swagger.io
- Goto http://generator.swagger.io
- Server --> Post --> aspnetcore or spring with following
{
"spec": {},
"options": {},
"swaggerUrl": "https://gist.githubusercontent.com/albert-visser/e3340fa6f03a929441b6d65f424924c7/raw/dc6a0443aa9f453088f2c69365a3ad60b1681dd7/swagger"
}
- Download zipfile
Result: zip file with an event class
Spring:public class Event {
Aspnetcore:public partial class Event : IEquatable<Event>
This is wrong, classes from http://generator.swagger.io should inherit EventPost.
Using swagger-codegen-cli-2.2.2
- Using the cli the result is same as http://generator.swagger.io
java -jar swagger-codegen-cli-2.2.2.jar generate -i https://gist.githubusercontent.com/albert-visser/e3340fa6f03a929441b6d65f424924c7/raw/dc6a0443aa9f453088f2c69365a3ad60b1681dd7/swagger -l aspnetcore -o .\output
Result: Same as http://generator.swagger.io
Related issues
Suggest a Fix
I've checked what http://editor.swagger.io is doing different, it is actually using http://generator.swagger.io for generation. But instead of posting a link it will include swagger in the body.