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

[feat]: support for x-additionalPropertiesName when generating property names #131

Closed
burnpiro opened this issue Jan 28, 2022 · 0 comments
Closed

Comments

@burnpiro
Copy link
Contributor

At this moment when someone is using additionalProperties it generates property1 and property2 as key names. Sampler could use the x-additionalPropertiesName property to generate custom property names:

{
   additionalProperties: {
      type: 'string', 
      'x-additionalPropertiesName': 'attribute-name'
   }
}

Generates:

{
      'property1': 'string',
      'property2': 'string'
}

and the output should look like this:

{
      'attribute-name1': 'string',
      'attribute-name2': 'string'
}

Default property name should remain the same when no x-additionalPropertiesName is defined.

This is not a standard property of additionalProperties but Redocly supports it in the schema definition. I'll make a PR to change it.

burnpiro added a commit to burnpiro/openapi-sampler that referenced this issue Jan 28, 2022
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