Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Colons declared in model property names removed #1080

Closed
smasala opened this issue Sep 21, 2018 · 1 comment
Closed

Colons declared in model property names removed #1080

smasala opened this issue Sep 21, 2018 · 1 comment

Comments

@smasala
Copy link
Contributor

smasala commented Sep 21, 2018

Description

As discussed with @wing328:

swagger-api/swagger-codegen#4290 (comment). We have some models where the JSONProperty is set to a colon notated name. Due to the fact that the colons are automatically removed from the property name, the interfaces generated (typescript) are no longer identical with the JSON produced. We then need to resort to ts hacks such as:

myVariable['my:prop:name' as keyof MyModel] as string

@smasala
Copy link
Contributor Author

smasala commented Sep 24, 2018

@wing328 We've now migrated over to OpenAPI Generator from Swagger Code Gen. The colons are now present in the typescript interface property names but without quotation marks.

interface MyTSInterface {
   my:prop: 'hello';
}

smasala pushed a commit to smasala/openapi-generator that referenced this issue Oct 1, 2018
smasala added a commit to smasala/openapi-generator that referenced this issue Oct 2, 2018
wing328 pushed a commit that referenced this issue Oct 3, 2018
* Allow colons in interface property names: #1080

* replace tabs with spaces

* add docs

* add example in doc

* update docs

* update docs

* remove language specific docs in DefaultCodegen

* Delete addPet-BodyParams.csv

* remove toPropertyName and update toVarName instead for TS
@smasala smasala closed this as completed Oct 4, 2018
A-Joshi pushed a commit to ihsmarkitoss/openapi-generator that referenced this issue Feb 27, 2019
* Allow colons in interface property names: OpenAPITools#1080

* replace tabs with spaces

* add docs

* add example in doc

* update docs

* update docs

* remove language specific docs in DefaultCodegen

* Delete addPet-BodyParams.csv

* remove toPropertyName and update toVarName instead for TS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant