The RestSharp.dll generated does not have RestClient.addQueryParameters. Looks like its being used when creating a REST Request.This looks like a dependency issue. This was fixed when i manually created a dll from the latest RestSharp library. It will be great if the auto-generated dll is the latest version. Error:
src\main\csharp\IO\Swagger\Client\ApiClient.cs(66,17): error CS1061:
'RestSharp.RestRequest' does not contain a definition for
'AddQueryParameter' and no extension method 'AddQueryParameter'
accepting a first argument of type 'RestSharp.RestRequest' could be
found (are you missing a using directive or an assembly reference?)
src\main\csharp\IO\Swagger\Client\ApiClient.cs(80,40): error CS1061:
'RestSharp.RestClient' does not contain a definition for
'ExecuteTaskAsync' and no extension method 'ExecuteTaskAsync' accepting
a first argument of type 'RestSharp.RestClient' could be found (are you
missing a using directive or an assembly reference?)
{
"packageName": "com.testing"
}
"/service/testService/getInnerMap":{"get":{"tags":["test"],"summary":"This is test service","operationId":"getInnerMapUsingGET","consumes":["application/json"],"produces":["*/*"],"responses":{"200":{"description":"OK","schema":{"type":"object","additionalProperties":{"$ref":"#/definitions/Map«string,string»"}}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not Found"}}}}
Here, if you see "#/definitions/Map«string,string»", it should be ideally "#/definitions/Map<string,string>". Hence it gives compilation issue. I think it is a bug, correct me if i am wrong.
Thanks,
Amit
"#/definitions/Map<string,string>"
--
You received this message because you are subscribed to the Google Groups "Swagger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggersocket+unsub...@googlegroups.com.
--
You received this message because you are subscribed to a topic in the Google Groups "Swagger" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/swagger-swaggersocket/AoNJh01yk_I/unsubscribe.
To unsubscribe from this group and all its topics, send an email to swagger-swaggers...@googlegroups.com.
To unsubscribe from this group and all its topics, send an email to swagger-swaggersocket+unsub...@googlegroups.com.
"/service/testService/getMap":{"get":{"tags":["test"],"summary":"This is test service","operationId":"getMapUsingGET","consumes":["application/json"],"produces":["*/*"],"parameters":[{"in":"body","name":"m","description":"m","required":false,"schema":{"type":"object","additionalProperties":{"type":"string"}}}],"responses":{"200":{"description":"OK","schema":{"type":"object","additionalProperties":{"type":"string"}}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not Found"}}}}
If you see, the generated spec is in accordance with https://github.com/swagger-api/swagger-spec/blob/master/versions/2.0.md#model-with-mapdictionary-properties. However, the C# generated code looks like:
>> public Dictionary<String, string> GetMapUsingGET (Object m)
a) The input parameter should be Dictionary<string, string>, instead it is getting converted to an object. Please let me know if this a bug. b) [Not a Major issue, just a doubt] Also, the return type is generated as "Dictionary<String, string>". Why is there an inconsistency in this("String" and "string")? Is this expected
13) Codegen for Model Objects:
I have a simple Model Object, as follows:
>> public class Bundle
{
private Integer myBundleId;
private Integer myBookId;
private Integer myParentBookId;
private String myName;
private String myAbbrev;
public Integer getBundleId()
{
return myBundleId;
}
.......
The model object generated by codegen looks like:
>>
This gives a compilation issue as visible from the screenshot. Please let me know what can i do here?
Thanks,
Amit
14) @RequestParam for Maps [Not a major issue]
Code:
>> @Override
@ApiOperation(value = "This is test service")
@RequestMapping(value = "/getMap", method = GET)
@ResponseBody
public Map<String, String> getMap(@RequestParam Map<String, String> m) ;
Generated Spec:
>>
,"/service/testService/getMap":{"get":{"tags":["test"],"summary":"This is test service","operationId":"getMapUsingGET","consumes":["application/json"],"produces":["*/*"],"parameters":[{"name":"m","in":"query","description":"m","required":true,"type":"ref"}],"responses":{"200":{"description":"OK","schema":{"type":"object","additionalProperties":{"type":"string"}}},"401":{"description":"Unauthorized"},"403":{"description":"Forbidden"},"404":{"description":"Not Found"}}}}
When do i do codegen, it is able to generate the same erroneous method as i mentioned in (12), however it throws the following exception in the console:
>>
{
"type": "object", "additionalProperties": { "$ref":"#/definitions/Map«string,string»" } }
{
"type": "object", "additionalProperties": { "type": "string" } }
class MapOfStringToString extends Map<String, String> { }
{ "type": "object", "additionalProperties": { "$ref":"#/definitions/MapOfStringToString»" } }
{
"type": "object", "additionalProperties": { "type": "string" } }
To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggersocket+unsub...@googlegroups.com.
```Java
...
.forCodeGeneration(true); // will not render the symbols
...
```