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

Ensure discriminated resource names are prefixed with the parent resource name #140

Merged
merged 1 commit into from
May 2, 2024

Conversation

praneetloke
Copy link
Member

@praneetloke praneetloke commented May 1, 2024

Endpoint paths that use a discriminator need to have their resource names prefixed with the parent resource. Note that the "parent resource" here just means the base resource name. For example, take the following endpoint /services. If there is a discriminator mapping like this:

discriminator:
  web: "#/components/schemas/web"
  static_site: "#/components/schemas/staticsite"

Then the "web" resource should be named ServicesWeb or ServicesStaticSite. This ensures that resources are "namespaced" by their base resource name.

Note: This was already the case when handling POST request method but the same type of naming was needed in the other request methods as well, which is what this PR does.

@praneetloke praneetloke merged commit 588886e into main May 2, 2024
1 check passed
@praneetloke praneetloke deleted the praneetloke/discriminated-resource-naming branch May 2, 2024 03:42
praneetloke added a commit that referenced this pull request May 3, 2024
praneetloke added a commit that referenced this pull request May 3, 2024
* Revert "Ensure discriminated resource names are prefixed with the parent resource name (#140)"

This reverts commit 588886e.

* Don't use the parent name for discriminated resources
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.

1 participant