nuxtswagger icon indicating copy to clipboard operation
nuxtswagger copied to clipboard

Enclose object keys in string if it contains numbers

Open MarcusOhman91 opened this issue 3 years ago • 0 comments

Fixes a bug where it generates invalid object syntax if your swagger spec contains a path with a number. For example "/auth/2fa" would generate an object { auth: { 2fa: {...} } } This adds a check that wraps the key in single-quotes if the key contains a number, resulting in correct syntax, for example: { auth: { '2fa': {...} } }

MarcusOhman91 avatar Oct 20 '22 13:10 MarcusOhman91