Forum Discussion
Hey kdivelbiss. It looks like the regular expression in the error message doesn't like the brackets in the attribute. But if a definition is valid OAS, then ReadyAPI should be able to import it.
Would it be possible for you to attach the definition file in question so I can do a quick test on my machine to see if I can import it?
- kdivelbiss4 years agoNew Contributor
Hi joejoyce. Thanks for responding. I've isolated the issue to that of using a public nested class as the response type as well as using the SwaggerGenOption c.CustomSchemaIds(x => x.FullName). This produces a schema definition in the swagger.json file containing the '+' character (Namespace.ParentClass+NestedClass). When importing the api definition in ReadyApi, I get the error message:
"attribute components.schemas.Schema name Namespace.ParentClass+NestedClass doesn't adhere to regular expression ^[a-zA-Z0-9\.\-_]+$"
If the nested class is moved outside the parent class, then the schema in the swagger.json file is generated using a '.' instead of a '+' and it works.
I have attached a sample project that demonstrates this.
- kdivelbiss4 years agoNew Contributor
joejoyce I just wanted to follow up with the question about whether or not the issue of the ReadyAPI not being able to import the schema in the generated swagger.json file when it contains the '+' character is expected behavior or not. If it is, then I will work on refactoring our code so that it generates the schema without the '+' character.
Thanks.
Related Content
- 3 years ago
Recent Discussions
- 5 days ago
- 10 days ago