swagger-api / swagger-api/swagger-codegen
[Java] JAXRS-Jersey : Format not respected for path parameters type
Nobody has claimed this yet.
- Dominant language
- Mustache
- Stars
- 17.8k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
Description
The format for a path operation parameter type is not respected when generating the Service formal parameters
Swagger-codegen version
Seen in 3.0.0-20180411.134218-60 and earlier 3.0.0 versions
Swagger declaration file content or url
---
swagger: "2.0"
info:
description: "No description"
version: "1.0.0"
title: "PathLongBug"
consumes:
- "application/json"
produces:
- "application/json"
paths:
/path/{identifier}:
get:
parameters: []
responses:
200:
description: "Status 200"
schema:
type: "number"
format: "int64"
parameters:
- name: "identifier"
in: "path"
required: true
type: "integer"
format: "int64"
Generates partial PathApiService.java
public abstract class PathApiService {
public abstract Response pathIdentifierGet(Integer identifier,SecurityContext securityContext) throws NotFoundException;
where identifier should be Long.
Command line used for generation
swagger-codegen-cli-3.0.0-20180411.134218-60.jar generate -l jaxrs-jersey -i pathLongBug.yaml -o pathLongBug
Steps to reproduce
Copy paste example pathLongBug.yaml file
Run command line above
Go to pathLongBug\src\gen\java\io\swagger\api. identifier should be a Long.
Suggest a fix/enhancement
The format property should be respected for path operation parameter types.
Note this is different from issue 7754
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by saving the supplied Swagger declaration as pathLongBug.yaml and running the documented swagger-codegen-cli command with the jaxrs-jersey generator. Inspect the generated PathApiService.java and compare the type of identifier with the declared integer format int64. Done means the generated pathIdentifierGet method uses Long for identifier.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100