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

Component names can only contain the characters A-Z a-z 0-9 - . _ #2331

Open
Emil-H opened this issue Feb 7, 2022 · 2 comments
Open

Component names can only contain the characters A-Z a-z 0-9 - . _ #2331

Emil-H opened this issue Feb 7, 2022 · 2 comments
Labels
bug help-wanted A change up for grabs for contributions from the community p2 Medium priority

Comments

@Emil-H
Copy link

Emil-H commented Feb 7, 2022

Hi, using Swashbuckle.AspNetCore v6.2.3

Enums defined in a class seems to generate a ref with the plus char. This is not allowed according to the specification:
https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.1.md#componentsObject

For example:
Semantic error at components.schemas.Adyen.Model.Checkout.PaymentResponse+ResultCodeEnum
Component names can only contain the characters A-Z a-z 0-9 - . _

@domaindrivendev domaindrivendev added the p2 Medium priority label Feb 7, 2022
@JustArchi
Copy link
Contributor

Just got hit by this, it's not perfect solution, but will do until a better fix is implemented:

services.AddSwaggerGen(
	static options => {
		options.CustomSchemaIds(static type => type.ToString().Replace('+', '-'));
	}
);

Copy link
Contributor

This issue is stale because it has been open for 60 days with no activity. It will be automatically closed in 14 days if no further updates are made.

@github-actions github-actions bot added the stale Stale issues or pull requests label Apr 30, 2024
@martincostello martincostello added bug help-wanted A change up for grabs for contributions from the community and removed stale Stale issues or pull requests labels Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug help-wanted A change up for grabs for contributions from the community p2 Medium priority
Projects
None yet
Development

No branches or pull requests

4 participants