You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
I have defined alias for enum in swagger.yml :
components:
schemas:
Colors:
type: string
enum: &COLORS
- black
- white
- red
- green
- blue
but it does not recognised properly in routes file.
routes:
###
# summary: Get logged user
# parameters:
# - name: category_id
# in: query
# type: integer
# required: false
# - name: product_type
# in: query
# type: string
# enum: *COLORS
# - name: date
# in: query
# type: string
# pattern: '^\d{2}-\d{2}-\d{4}$'
# required: false
# description: Date in format dd-MM-yyyy
# responses:
# 200:
# description: json with provision table definitions
###
GET /users controllers.HomeController.index
I'm getting exception when use sbt command swagger or run:
[play-swagger-alias] $ run
[info] Running com.iheart.playSwagger.SwaggerSpecRunner /media/dawid/DATA/praca/it.impossible/play-swagger-alias/target/swagger/swagger.json routes models false 1.0-SNAPSHOT false
[error] (run-main-0) found undefined alias COLORS
[error] in 'string', line 11, column 10:
[error] enum: *COLORS
[error] ^
[error] found undefined alias COLORS
[error] in 'string', line 11, column 10:
[error] enum: *COLORS
[error] ^
[error]
[error] at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:137)
[error] at org.yaml.snakeyaml.composer.Composer.composeValueNode(Composer.java:246)
[error] at org.yaml.snakeyaml.composer.Composer.composeMappingChildren(Composer.java:237)
[error] at org.yaml.snakeyaml.composer.Composer.composeMappingNode(Composer.java:225)
[error] at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:154)
[error] at org.yaml.snakeyaml.composer.Composer.composeSequenceNode(Composer.java:199)
[error] at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:152)
[error] at org.yaml.snakeyaml.composer.Composer.composeValueNode(Composer.java:246)
[error] at org.yaml.snakeyaml.composer.Composer.composeMappingChildren(Composer.java:237)
[error] at org.yaml.snakeyaml.composer.Composer.composeMappingNode(Composer.java:225)
[error] at org.yaml.snakeyaml.composer.Composer.composeNode(Composer.java:154)
[error] at org.yaml.snakeyaml.composer.Composer.composeDocument(Composer.java:122)
[error] at org.yaml.snakeyaml.composer.Composer.getSingleNode(Composer.java:105)
[error] at org.yaml.snakeyaml.constructor.BaseConstructor.getSingleData(BaseConstructor.java:122)
[error] at org.yaml.snakeyaml.Yaml.loadFromReader(Yaml.java:505)
[error] at org.yaml.snakeyaml.Yaml.load(Yaml.java:424)
[error] at com.iheart.playSwagger.SwaggerSpecGenerator.parseYaml(SwaggerSpecGenerator.scala:301)
[error] at com.iheart.playSwagger.SwaggerSpecGenerator.$anonfun$endPointSpec$1(SwaggerSpecGenerator.scala:352)
[error] at scala.Option.map(Option.scala:163)
[error] at com.iheart.playSwagger.SwaggerSpecGenerator.tryParseYaml$1(SwaggerSpecGenerator.scala:352)
[error] at com.iheart.playSwagger.SwaggerSpecGenerator.$anonfun$endPointSpec$15(SwaggerSpecGenerator.scala:404)
[error] at scala.Option.orElse(Option.scala:306)
Hi,
I have defined alias for enum in
swagger.yml
:but it does not recognised properly in routes file.
routes:
I'm getting exception when use sbt command
swagger
orrun
:seems that generator does not know alias
I pushed example project with bug here: https://github.com/meloniasty/play-swagger-alias
The text was updated successfully, but these errors were encountered: