Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kotlin support of "." (dot) on variable name causing an issue with query parameters' kotlin variable names with dots is shown as syntax error. #73

Closed
yudhir opened this issue Dec 5, 2019 · 1 comment · Fixed by #77

Comments

@yudhir
Copy link

yudhir commented Dec 5, 2019

  fun apiSectionsArticlesGetSubresource(
    @retrofit2.http.Path("id") id: String,
    @retrofit2.http.Query("dateCreated[before]") dateCreatedBefore: String?,
   ...
   ...
    @retrofit2.http.Query("datePublished[after]") datePublishedAfter: String?,
    @retrofit2.http.Query("datePublished[strictly_after]") datePublishedStrictlyAfter: String?,
    @retrofit2.http.Query("author") author: String?,
    @retrofit2.http.Query("author[]") author2: List<String>?,
This above was fixed in #31 
    @retrofit2.http.Query("articlesection.name") articlesection.name: String?, //Shown as syntax error articlesection.name

    @retrofit2.http.Query("articlesection") articlesection: String?,
    @retrofit2.http.Query("articlesection[]") articlesection2: List<String>?, #fix 31
    @retrofit2.http.Query("author.name") authorname: String?,// Manual Fix , remove dot . 
    @retrofit2.http.Query("page") page: Int?,
    @retrofit2.http.Query("itemsPerPage") itemsPerPage: Int?
  ): Single<List<ArticleMinusarticleRead>>```

Swagger

{
        "tags": [
          "Article"
        ],
        "summary": "Retrieves the collection of Article resources.",
        "operationId": "getArticleCollection",
        "produces": [
          "application/ld+json",
          "application/json",
          "text/html",
          "application/hal+json",
          "multipart/form-data",
          "application/vnd.api+json"
        ],
        "parameters": [
          {
            "name": "dateCreated[before]",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "dateCreated[strictly_before]",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "dateCreated[after]",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "dateCreated[strictly_after]",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "dateModified[before]",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "dateModified[strictly_before]",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "dateModified[after]",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "dateModified[strictly_after]",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "datePublished[before]",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "datePublished[strictly_before]",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "datePublished[after]",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "datePublished[strictly_after]",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "author",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "author[]",
            "in": "query",
            "required": false,
            "type": "array",
            "items": {
              "type": "string"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "articlesection.name",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "articlesection",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "articlesection[]",
            "in": "query",
            "required": false,
            "type": "array",
            "items": {
              "type": "string"
            },
            "collectionFormat": "multi"
          },
          {
            "name": "author.name",
            "in": "query",
            "required": false,
            "type": "string"
          },
          {
            "name": "page",
            "in": "query",
            "description": "The collection page number",
            "required": false,
            "type": "integer"
          },
          {
            "name": "itemsPerPage",
            "in": "query",
            "description": "The number of items per page",
            "required": false,
            "type": "integer"
          }
        ],
        "responses": {
          "200": {
            "description": "Article collection response",
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/definitions/Article-article.read"
              }
            }
          }
        }
      }
cortinico added a commit to cortinico/swagger-gradle-codegen that referenced this issue Dec 26, 2019
@cortinico
Copy link
Collaborator

Thanks for reporting this @yudhir and sorry for the late reply.
This is really similar to #31

I'm going to fix this in this PR #77

macisamuele added a commit that referenced this issue Dec 30, 2019
Allow dot in parameter names for operations (#73)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants