Description
The operationId field of paths can have values which are not valid Elm identifiers. It seems that these values are used unmodified to produce Elm function names, meaning that the generator produces invalid Elm code.
This happens, for example, when operationId values contain "."s, as is common when using connexion.
openapi-generator version
Latest. Not sure.
Swagger declaration file content or url
basePath: /
consumes:
- application/json
info:
description: An API
title: An API
version: '1.0'
paths:
/:
get:
operationId: get.foo.bar
responses:
'200':
description: Success
produces:
- application/json
swagger: '2.0'
Command line used for generation
openapi-generator generate -i broken.yaml -l elm -o gen
Steps to reproduce
- Put the above YAML into
broken.yaml
- Run the command above
Suggest a fix/enhancement
At least for my purposes, replacing '.' with '_' in the function names would do the trick. There may be more characters in valid operationId's which are invalid in Elm identifiers, though, so someone who knows the spec should find all translations that need to happen.
Description
The
operationIdfield of paths can have values which are not valid Elm identifiers. It seems that these values are used unmodified to produce Elm function names, meaning that the generator produces invalid Elm code.This happens, for example, when
operationIdvalues contain "."s, as is common when using connexion.openapi-generator version
Latest. Not sure.
Swagger declaration file content or url
Command line used for generation
openapi-generator generate -i broken.yaml -l elm -o gen
Steps to reproduce
broken.yamlSuggest a fix/enhancement
At least for my purposes, replacing '.' with '_' in the function names would do the trick. There may be more characters in valid operationId's which are invalid in Elm identifiers, though, so someone who knows the spec should find all translations that need to happen.