Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't this be
Optional[EggRelationships]
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh my bad you right! Ok so the problem get more complicated that i was thinking. How you implemented for now doesn't give the ability to automatically use the type
EggRelationships
and will return adict
instead which make the typing wrong.Maybe your usage of the library would be to convert it later? For now I removed it because I'm not sure if this is usefull or no but I think kept the default value for the
Optional
type is a good thing.On one of my library i use https://github.com/konradhalas/dacite which could be a perfect usage here, but after some try a lot of the typing in your
types
classes are incompatible with the current version of pterodactyl API sadly. The only "problem" I can see is: this will be a breaking change since it will automatically return the correct type. For exampleEgg.config
will return anEggConfiguration
object instead of adict
, while it's what the typing say it will do.I can make a PR for that if you want to test how it look on your end.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it's returning a type that isn't what the type definition says, it's a bug, so I think it would be fine to implement this without it being a breaking change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hum ok, so what I propose then is: we can merge this one. I removed the
EggRelationships
class for now and will do another PR with everything patched then.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's no need to remove it entirely – you can just implement the patch for type conversions in another PR. This can be closed for now.