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

Add includePreludeShapes in model plugin #1693

Merged
merged 1 commit into from
Mar 27, 2023

Conversation

AndrewFossAWS
Copy link
Contributor

Issue #, if available:
#947

Description of changes:

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@AndrewFossAWS AndrewFossAWS requested a review from a team as a code owner March 24, 2023 16:00
@mtdowling
Copy link
Member

mtdowling commented Mar 24, 2023

I think you shouldn’t be able to change the default model plugin. Instead, they can use a custom instance of the model plugin using the plugin ID syntax introduced for process plugins “model::withPrelude” and then they can add the new property you introduced here.

So this means:

  1. Always overwrite any built-in plugins. This ensures that you can rely on consistent behavior and output no matter the configuration.
  2. Use the new plugin ID syntax of "plugin-name::artifact-name". So this becomes "model:modelWithPrelude".

For example, this would work:

{
    "version": "1.0",
    "projections": {
        "source": {
            "plugins": {
                "model::modelWithPrelude": {
                    "includePreludeShapes": true
                }
            }
        }
    }
}

This would be ignored since built-in plugins take precedence.

{
    "version": "1.0",
    "projections": {
        "source": {
            "plugins": {
                "model": {
                    "includePreludeShapes": true
                }
            }
        }
    }
}

@AndrewFossAWS AndrewFossAWS merged commit 9523435 into smithy-lang:main Mar 27, 2023
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.

2 participants