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

Group schema updates #4258

Merged
merged 6 commits into from
Jul 18, 2023
Merged

Group schema updates #4258

merged 6 commits into from
Jul 18, 2023

Conversation

kwasniew
Copy link
Contributor

About the changes

OpenAPI schemas for group, groups and group user

Important files

Discussion points

@sonatype-lift
Copy link

sonatype-lift bot commented Jul 17, 2023

Sonatype Lift is retiring

Sonatype Lift will be retiring on Sep 12, 2023, with its analysis stopping on Aug 12, 2023. We understand that this news may come as a disappointment, and Sonatype is committed to helping you transition off it seamlessly. If you’d like to retain your data, please export your issues from the web console.
We are extremely grateful and thank you for your support over the years.

📖 Read about the impacts and timeline

@vercel
Copy link

vercel bot commented Jul 17, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
unleash-monorepo-frontend ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 18, 2023 8:45am
1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
unleash-docs ⬜️ Ignored (Inspect) Jul 18, 2023 8:45am

Copy link
Contributor

@thomasheartman thomasheartman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good! Got a few small suggestions, but nothing preventing this from going in 💯

@@ -7,49 +7,67 @@ export const groupSchema = {
type: 'object',
additionalProperties: true,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a response schema, right? In that case, this should be false

Suggested change
additionalProperties: true,
additionalProperties: false,

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one is shared for request and response schema. Once I get to the create schemas I may split those two. But for now I only wanted to add examples/descriptions

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it. That's fine, but we should definitely split them in a follow-up, then. The ID property probably does nothing when you create it, for instance.

type: 'number',
description: 'The group id',
type: 'integer',
example: 1,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not blocking and not really important on response schemas, but what's the minimum ID we use? We could indicate that here 💁🏼

Suggested change
example: 1,
example: 1,
minimum: 1, // or 0?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my DB it's 1 but it's a DB implementation detail so not sure if it adds much value

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, and because it's not something you can set yourself, it doesn't matter much. I'd set it to 0 so that people can used unsigned integers if they want to, but I'll leave it up to you.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually 0 should never occur because postgres starts counting from 1 at least on my machine. But I don't want to make too many assumptions here

src/lib/openapi/spec/group-user-model-schema.ts Outdated Show resolved Hide resolved
src/lib/openapi/spec/group-user-model-schema.ts Outdated Show resolved Hide resolved
src/lib/openapi/spec/group-user-model-schema.ts Outdated Show resolved Hide resolved
Co-authored-by: Thomas Heartman <thomas@getunleash.ai>
@kwasniew kwasniew merged commit 276261c into main Jul 18, 2023
17 checks passed
@kwasniew kwasniew deleted the group-schema-updates branch July 18, 2023 09:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

3 participants