Comments (7)
Looks like you are missing the responseClass. The error reporting is not good right now but the trace points here:
from swagger-codegen.
Thanks for the response. That's what I figured. So I guess my question is as follows. Is there a reason why certain fields are required in swagger-codegen but are not required in swagger-ui? Again, I am simply feeding the output from grape-swagger into both, and it works in swagger-ui, but not in swagger-codegen.
from swagger-codegen.
Yes, the code generator is more strict with structure that the ui. Valid swagger specs are best, of course.
from swagger-codegen.
Thanks again for the explanation. I was able to get this to work by monkey-patching the swagger-grape gem to add the responseClass and errorResponses keys to Operations, and added the models key to the ApiListing (all of which are missing in the most recent version of the gem). I'll submit a pull request to the grape-swagger project that will implement these missing keys.
from swagger-codegen.
Thank you. And we will improve the validator messages as well as make a javascript version that's bundled with Swagger-ui.
from swagger-codegen.
bfreeman123, did you ever submit that pull request? I'm running into the same issues ..
from swagger-codegen.
No, I did not. While my patch got the code generator over that hurdle, it merely spit out un-usable code (at least for objective-c). As I recall, it wasn't mapping attributes correctly. I have since moved onto another project and abandoned the swagger codegen, but if you'd like to give it a try, you can simply add the responseClass key to the Operations hash on the grape-swagger gem.
If you look at https://github.com/tim-vandecasteele/grape-swagger/blob/master/lib/grape-swagger.rb starting on line 91, you essentially want to change:
operations = {
:notes => notes,
:summary => route.route_description || '',
:nickname => route.route_method + route.route_path.gsub(/[\/:\(\)\.]/,'-'),
:httpMethod => route.route_method,
:parameters => parse_header_params(route.route_headers) +
parse_params(route.route_params, route.route_path, route.route_method)
}
to
operations = {
:notes => notes,
:summary => route.route_description || '',
:nickname => route.route_method + route.route_path.gsub(/[\/:\(\)\.]/,'-'),
:httpMethod => route.route_method,
:parameters => parse_header_params(route.route_headers) +
parse_params(route.route_params, route.route_path, route.route_method),
:responseClass => @@class_name
}
from swagger-codegen.
Related Issues (20)
- qt5cpp codegen appears wrong for arrays of integers
- Cli unable to pull from localhost on host machine
- Cannot parse openapi spec with Plugin or even with built package - JsonParseException: Unrecognized token 'openapi'
- Broken image on dockerhub - Java Runtime support up to v.52 but was compiled with v.55 HOT 1
- [C#] Instantiation type is ignored
- Update readme
- [python] bug cant run vanilla shipped Petstore python-flask generated code HOT 3
- Schema generation for AsyncApi
- [elixir] Explicitly set @moduledoc false when empty
- OneOf property is failing during OAS Schema Validation
- [Typescript] Multiple duplicate identifiers in generated client. HOT 2
- Docker images for swagger-codegen-cli-v3 error out on startup due to incompatible JVM version HOT 1
- ERRORUNKNOWN in java okhttp4-gson template HOT 3
- [Python] Issue with Multipart/Form-Data Requests
- [Java] fix connection leak on retrofit OAuth token renewal in V3
- [ASPNETCORE] bad character in generated file HOT 1
- HTML2 output contains errors and does not match API code or documentation HOT 2
- [PYTHON] Error when receiving .zip file octet-stream response from API endpoint HOT 1
- [Typescript] the java back end writed controller function as ‘HashMap<String, Object>’ to be return type,but generated ts code is error... HOT 1
- [JAVA] Performance issues with AbstractJavaCodegen.toModelName() HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from swagger-codegen.