-
Notifications
You must be signed in to change notification settings - Fork 206
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
Suffix support to the schema name and why numbers are appended to schema name like Note2 #404
Comments
@anuraggo Again, sorry for the delay. We recently merged in #399 (see #379 for the discussion). This adds the ability to add extensions in the OAS to define custom type and field names. To clarify, appending numbers is intended when multiple types or fields share the same "preferred" name, aka the derived name from references, properties, etc. Most likely there is another type in your generated GraphQL interface that has the name |
I need to make a new release but the extensions are your recommended solution. Edit: Try v2.4.0 and see the following: https://github.com/IBM/openapi-to-graphql/tree/master/packages/openapi-to-graphql#custom-type-and-field-names-and-enum-values |
Hello @Alan-Cha , Thanks for your reply. Usage of OAS extensions needs updating the swagger schema annd I don't have that option to update it.Hence I have tried writing below wrapper to modify the OAS js-object to insert the extension before invoking the method createGraphQLSchema. It is updating the oas object properly but not in the graphql schema . const definitions = oass[oasKey].definitions || {}; This is updating the oas object as : SystemListValue: { But the final graphql output schema is not appending the suffix for all the types. |
Hello,
Is there any way we can add a suffix/prefix to the model Definitions like below:
type <defintion_name>_responseSuffix {
}
Also, I have observed that openapi-to-graphql appends number to the defintions name such as Note2
May I know how can we omit this or bypass If I want to display only Note ?
@Alan-Cha Can you please help me here ?
The text was updated successfully, but these errors were encountered: