Android default will not be considered

Open
#8,518 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
30/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
android, java

Research direction

Start with the Android Java model-generation path and compare the generated LoginRequest shown in the issue with the provided Swagger schema. The work is done when the generated model considers the schema defaults for method, id, and jsonrpc rather than initializing them to null.

Written by the indexing model from the issue text.

Description

Swagger-codegen Version 2.3.1 . The default values of paramters are not considered.

Json of the API

LoginRequest": {
      "required": [
        "params"
      ],
      "properties": {
        "params": {
          "$ref": "#/definitions/LoginParams"
        },
        "method": {
          "type": "string",
          "default": "mystring"
        },
        "id": {
          "type": "string",
          "default": "mystring"
        },
        "jsonrpc": {
          "type": "string",
          "default": "2.0"
        }
      },
      "type": "object"
    },

Android Java result

@ApiModel(description = "")
public class LoginRequest {
  
  @SerializedName("params")
  private LoginParams params = null;
  @SerializedName("method")
  private String method = null;
  @SerializedName("id")
  private String id = null;
  @SerializedName("jsonrpc")
  private String jsonrpc = null;
Dominant language
Mustache
Stars
17.8k
Forks
6k
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from swagger-api/swagger-codegen

All issues in swagger-api/swagger-codegen

Similar issues

More Mobile Dev issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.