swagger-api / swagger-api/swagger-codegen
[JAX-RS 2.0] @JsonProberties are not assigned, always null
Nobody has claimed this yet.
- Dominant language
- Mustache
- Stars
- 17.8k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
On the generator a always recieved null for a List. I fixed it by renaming the proberty "xPathsToBeRedacted" to "pathsToBeRedacted".
I used this part of the swagger-file: (now works)
paths:
/redact:
post:
tags:
- redact
consumes:
- application/json
produces:
- application/xml
parameters:
- name: redactOperation
in: body
required: true
schema:
$ref: '#/definitions/redactOperation'
responses:
'200':
schema:
type: string
default:
schema:
type: string
definitions:
redactOperation:
type: object
properties:
signerId:
type: string
signedXML:
type: string
pathsToBeRedacted:
type: array
xml:
wrapped: false
items:
type: string
xml:
name: redactOperation
I feel there might be a naming conflict. I debuggt it a little and noticed, that at the
initialisation of the gen/java/model/RedactOperation the method setXPathsToBeRedacted method was never called.
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 in the generated gen/java/model/RedactOperation class and inspect the pathsToBeRedacted property alongside the setXPathsToBeRedacted method mentioned in the report. Trace generation from the supplied Swagger definition and verify that the setter is called and the list is populated for the redactOperation model.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100