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

Custom generated spec behavior configuration #45

Merged
merged 3 commits into from Jan 17, 2017

Conversation

AntoineABI
Copy link
Contributor

Allow to alter the way custom spec (from tsao.json by default) is merged to generated swagger spec by a configuration option in SwaggerConfig interface named specMerging. The default value is meant to not break existing projects meaning this update is harmless.

 /**
   * Alter how the spec is merged to generated swagger spec.
   * Possible values:
   *  - 'immediate' is overriding top level elements only thus you can not append a new path or alter an existing value without erasing same level elements.
   *  - 'recursive' proceed to a deep merge and will concat every branches or override or create new values if needed. @see https://www.npmjs.com/package/merge
   * The default is set to immediate so it is not breaking previous versions.
   * @default 'immediate'
   */
  specMerging?: 'immediate' | 'recursive';

Neo added 3 commits January 17, 2017 20:33
…way.

Thus allowing a more flexible way of tweaking thoses specs!
…way.

Thus allowing a more flexible way of tweaking thoses specs!
(+fixing formatting)
…way.

Thus allowing a more flexible way of tweaking thoses specs!
(+fixing formatting)
@lukeautry
Copy link
Owner

Nice @AntoineABI , I really like this approach.

@lukeautry lukeautry changed the base branch from master to custom_spec_merge January 17, 2017 20:15
@lukeautry lukeautry merged commit 330ca9f into lukeautry:custom_spec_merge Jan 17, 2017
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.

None yet

2 participants