swagger-api / swagger-api/swagger-codegen
swagger-codegen generate Poor error message about something being null ( I guess ): WARN io.swagger.util.PropertyDeserializer - no property from int, null, {ENUM=null, TITLE=null,
Nobody has claimed this yet.
- Dominant language
- Mustache
- Stars
- 17.8k
- Forks
- 6k
- PR merge metrics
- No merged PRs in 30d
Description
Description
Poor error message about something being null ( I guess ).
Should provide line number and possibly column number and maybe something more depending on what the issue is.
I had several of these issues in my real spec but they eventually went way as I kept rewriting to match spec to the requirements. Still have no idea what causes it, sorry.
Cause by incorrect type: int. So I guess this is a variation on https://github.com/swagger-api/swagger-codegen/issues/5160
Swagger-codegen version
current master; HEAD = 1c160df33897898da1c39f230c737eb6a313e6ba
Swagger declaration file content or url
swagger: '2.0'
info:
title: "sscce"
version: '1.0'
description: sscce
definitions:
Pet:
type: object
properties:
no_legs:
type: int
name:
type: string
Cat:
allOf:
- $ref: "#/definitions/Pet"
- type: object
properties:
likes_water:
type: boolean
paths:
/foo:
post:
parameters:
- name: cat
in: body
schema: {$ref: "#/definitions/Cat"}
responses:
"200":
description: foo
type: string
Command line used for generation
JAR=".../swagger-codegen.git/modules/swagger-codegen-cli/target/swagger-codegen-cli.jar"
java -jar "${JAR}" generate -i ~/sscce.yaml -l html2 -o foo
outputs:
[main] INFO io.swagger.parser.Swagger20Parser - reading from sscce.yaml
[main] WARN io.swagger.util.PropertyDeserializer - no property from int, null, {ENUM=null, TITLE=null, DESCRIPTION=null, DEFAULT=null, PATTERN=null, DESCRIMINATOR=null, MIN_ITEMS=null, MAX_ITEMS=null, MIN_PROPERTIES=null, MAX_PROPERTIES=null, MIN_LENGTH=null, MAX_LENGTH=null, MINIMUM=null, MAXIMUM=null, EXCLUSIVE_MINIMUM=null, EXCLUSIVE_MAXIMUM=null, UNIQUE_ITEMS=null, EXAMPLE=null, TYPE=int, FORMAT=null, READ_ONLY=null, VENDOR_EXTENSIONS={}, MULTIPLE_OF=null}
[main] WARN io.swagger.codegen.DefaultCodegen - Empty operationId found for path: post /foo. Renamed to auto-generated operationId: fooPost
[main] INFO io.swagger.codegen.AbstractGenerator - writing file /home/yac/sscce.html/index.html
Fun fact: there is a breed of cats called Bengal cat who like water and they are domesticated by selectively breeding four generations from leopards or such.
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
Reproduce the warning with the supplied sscce.yaml and swagger-codegen-cli.jar command, then start at io.swagger.util.PropertyDeserializer and the parser output shown in the report. Done should mean an invalid type such as int produces an actionable warning identifying the relevant line and column, with the cause made clear.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, yaml
- Domain
- api, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100