Skip to content

Conversation

@filfreire
Copy link
Contributor

@filfreire filfreire commented Mar 30, 2022

Changelog(OpenAPI-2-Kong): Fixed an issue where Kong declarative config generation had different behaviour for name delimiters between Inso CLI's npm package and binary release

The problem

TL;DR: We have an issue where generating a kong declarative config, we replace dashes in original title of openapi specs with underscores. It's reproducible on tests, on inso-cli installed via github releases, and also on Insomnia plugin.

E.g.

<   - name: Sample-API
---
>   - name: Sample_API
13c13
<         name: Sample-API-list-get
---
>         name: Sample_API-list-get

Investigation

After pairing with @DMarby and @gatzjames we found out some things:

  • Folks that used inso-cli installed via npm (e.g. npm i insomnia-inso@2.8.0) faced a weird behavior where declarative kong configs that had names and some strings with stuff using - dashes stayed with dashes.
  • BUT, folks that used the generated the declarative config using the inso cli from Github, or in the Insomnia Plugin, the - dash characters were replaced with underscore.

This was happening due to a difference in versions of slugify.

The packaged inso/insomnia was using an older slugify version that caused - dashes to be wrongly replaced.
Folks using inso from NPM had the latest slugify version (e.g. 1.6.5) which didn't have this behavior.

Ultimately this difference in what slugify version was used on packaged inso vs. on inso via npm caused the overall weirdness that folks reported in #4432 and also in support tickets.

In this PR we pin slugify to 1.6.5 so the behavior stays consistent between packaged and npm inso, and we fixed and added tests to check the behavior is consistent.

TODO

  • add fixtures to reproduce the issue
  • add a fix

@filfreire filfreire requested a review from DMarby March 30, 2022 10:50
@filfreire filfreire marked this pull request as ready for review March 30, 2022 12:07
@filfreire filfreire changed the title (Draft) Reproduce and Fix #4432 Reproduce and Fix #4432 Mar 30, 2022
@filfreire filfreire enabled auto-merge (squash) March 30, 2022 13:05
Copy link
Contributor

@gatzjames gatzjames left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and works nice!

@filfreire filfreire merged commit e8c19f4 into develop Mar 30, 2022
@filfreire filfreire deleted the fix/4432 branch March 30, 2022 13:31
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

Successfully merging this pull request may close these issues.

4 participants