swagger-api/swagger-codegen

[R] Enums are not supported

Aperta

#6616 aperta il 3 ott 2017

 (3 commenti) (0 reazioni) (0 assegnatari)HTML (5474 fork)batch import
Client: REnhancement: FeatureFeature: Enumhelp wanted

Metriche repository

Star
 (12.701 stelle)
Metriche merge PR
 (Metriche PR in attesa)

Descrizione

Models that are enum classes are not being generated correctly, they are missing allowable values from the swagger specs.

How should enums be implemented since R doesn't support it?

Here's one solution: enumClass <- R6::R6Class( 'ElevationLevel', type1 = "TYPE_1", type2 = "TYPE_2", type3 = "TYPE_3", value = NULL public = list( initialize = function(value){ self$value <- value } ) )

@ramnov @wing328

Guida contributor