-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat(controller): getGroupById returns events #129
base: main
Are you sure you want to change the base?
Conversation
I guess if you fetch groups, with a list of events, that returns groups this could cause some kind of circular reference ? Causing openAPI to not be happy ? Also I have trouble understanding why ALL the attributes where required. Not only for events. shouldn't really be the MOST important information such as the name, the date etc. ? |
I had the same problem with the group. I think the best solution is to create another schemas for event and eventDescription, as i have done with the group below : findAMusicianBackend/api/docs/config/components.ts Lines 79 to 96 in 6182ce8
findAMusicianBackend/api/docs/config/components.ts Lines 97 to 109 in 6182ce8
|
Okay but why solving this by creating a whole new schema ? Why having all the attributes as required where by definition we should only have the most important ones ? |
because, for example, in the route |
But indeed, the fact that we have to re create a all new schema is not perfect.. maybe we could use the schema: {
type: 'object',
allOf: [
{ $ref: '#/components/schemas/musician' },
{
type: 'object',
required: ['groups'],
properties: {
groups: {
type: 'array',
items: {
$ref: '#/components/schemas/groupDescription',
},
},
},
},
],
},
``` |
I had to remove genre, admin and groups from events required filed.
OpenAPI would not fetch events in the get group call with those requirements.