Some fixes to Ruby docs on links and File parameter

This commit is contained in:
xhh
2016-03-09 19:36:28 +08:00
parent 43d2df9753
commit 91bae765ef
15 changed files with 1255 additions and 38 deletions

View File

@@ -199,6 +199,9 @@ public class RubyClientCodegen extends DefaultCodegen implements CodegenConfig {
setGemAuthorEmail((String) additionalProperties.get(GEM_AUTHOR_EMAIL));
}
// make api and model doc path available in mustache template
additionalProperties.put("apiDocPath", apiDocPath);
additionalProperties.put("modelDocPath", modelDocPath);
// use constant model/api package (folder path)
setModelPackage("models");
@@ -433,7 +436,7 @@ public class RubyClientCodegen extends DefaultCodegen implements CodegenConfig {
@Override
public String toModelDocFilename(String name) {
return toModelFilename(name);
return toModelName(name);
}
@Override
@@ -447,7 +450,7 @@ public class RubyClientCodegen extends DefaultCodegen implements CodegenConfig {
@Override
public String toApiDocFilename(String name) {
return toApiFilename(name);
return toApiName(name);
}
@Override

View File

@@ -65,7 +65,7 @@ end
# Assuming there's a `PetApi` containing a `get_pet_by_id` method
# which returns a model object:
pet_api = Petstore::PetApi.new
pet_api = {{moduleName}}::PetApi.new
pet = pet_api.get_pet_by_id(5)
puts pet.to_body
```

View File

@@ -37,7 +37,7 @@ end
{{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}}
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}}
{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{baseType}}.md){{/isPrimitiveType}}| {{description}} | {{^required}}[optional] {{/required}}{{#defaultValue}}[default to {{defaultValue}}]{{/defaultValue}}
{{#allParams}} **{{paramName}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}{{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}[**{{dataType}}**]({{baseType}}.md){{/isFile}}{{/isPrimitiveType}}| {{description}} | {{^required}}[optional] {{/required}}{{#defaultValue}}[default to {{defaultValue}}]{{/defaultValue}}
{{/allParams}}
### Return type