aj-foster / open-api-generator

Open API code generator for Elixir
MIT License
97 stars 13 forks source link

`operationId`s containing `{` or `}` creates code which wont compile #6

Closed aej closed 1 year ago

aej commented 1 year ago

I discovered this using the Hubspot companies API (https://api.hubspot.com/api-catalog-public/v1/apis/crm/v3/objects/companies)

In some cases the operationId contains {...}. Eg: "delete-/crm/v3/objects/companies/{companyId}_archive"

Open API generator will then generate code like

  @spec delete__crm_v3_objects_companies_{company_id}_archive(String.t(), keyword) :: :ok | {:error, binary}
  def delete__crm_v3_objects_companies_{company_id}_archive(companyId, opts \\ []) do
...

which won't compile since its invalid elixir.

aj-foster commented 1 year ago

Hi @aej, thank you for this report! I have some code in #9 that should resolve it. If you have a chance, can you check and see if it works for you?

aej commented 1 year ago

Just tested it out and it works!

aj-foster commented 1 year ago

Resolved by #9. Thank you! ❤️