Open MichalDanielDobrzanski opened 5 years ago
Hi @MichalDanielDobrzanski
I'm checking the problem you describe but I'm not sure if it's a generator problem or a definition problem. I explain, if the definition must be the final name of the class why you define it with dots instead of using the correct naming instead? If that swagger definition is auto-generated from the .NET backend service may it be corrected there IMHO. You want me to make a change to fit your needs when you should change how you name those objects. Is more like "linting" the JSON than changing the tool.
We can debate it if you're not agree.
"\/api\/sections\/{id}": {
"get": {
"tags": [
"Section"
],
"operationId": "getSectionItem",
"produces": [
"application\/ld+json",
"application\/json",
"text\/html",
"application\/hal+json",
"multipart\/form-data"
],
"summary": "Retrieves a Section resource.",
"parameters": [{
"name": "id",
"in": "path",
"required": true,
"type": "string"
}],
"responses": {
"200": {
"description": "Section resource response",
"schema": {
"$ref": "#\/definitions\/Section-section.read"
}
},
"404": {
"description": "Resource not found"
}
}
},
here is a snippet.
@ApiModel
final class Section-section.read { Error expecting top level declaration,
@ApiModelProperty
@SerializedName("name") Error Functio declaration must have a name
private var name: String```
@DELETE("/api/sections/{id}")
fun deleteSectionItem(): Observable
Hi @yudhir !
Why you named a reference that way? Since a reference should be a model from your definition, is there any reason for that?
Please could you post the definition of Section-section.read? Is auto-generated from an external service?
Thanks!
yes it was autogenerated from api-platform and probably a result of intenal Joins and Serialization and Normalization rules. here is my swagger
"Section-section.read": {
"type": "object",
"description": "The most generic type of item.",
"properties": {
"name": {
"description": "the name of the item",
"type": "string"
},
"image": {
"description": "An image of the item. This can be a \\[\\[URL\\]\\] or a fully described \\[\\[ImageObject\\]\\].",
"type": "string"
},
"description": {
"description": "a description of the item",
"type": "string"
},
"articles": {
"type": "array",
"items": {
"$ref": "#\/definitions\/Article-section.read"
}
},
"newsArticles": {
"type": "array",
"items": {
"$ref": "#\/definitions\/NewsArticle-section.read"
}
}
}
},
OpenaApi gen i think used SectionMinusSectionRead to get around this . I need an Rx, Retrofit solution , that is not available on the openapi-gen and swagger-gen .
Describe the bug Protein is a really cool tool, I like it! However, it has failed to generate right names for data classes. Generated classes are like "data class Class.V1.API.Model", and their names are put in Kotlin captions ``.
To Reproduce Just add dots in the object names in JSON file. Example:
Expected behavior The easiest way would be to trim dots and generate clients with CapitalCase naming convenetion (or camelCase):
CompanyMyAwesomeApiContractsV1SpecificSecondSpecific
The JSON file cannot be changed since it is generated via .NET code and they use dots for namespaces.Info Required
Which version of the plugin do you actually use? The latest one - 1.1.2
Any other thing that could help me to reproduce the error?
Screenshots
Additional context