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

Parse error on non typed types #53

Open
gottafixthat opened this issue Aug 31, 2024 · 2 comments
Open

Parse error on non typed types #53

gottafixthat opened this issue Aug 31, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@gottafixthat
Copy link

First off, thanks for the package. I've been evaluating it and I think it can work for me, which would save me a ton of time.

I'm running into a few issues, though, and this seems related to #27 since I was able to use the same workaround, but this fails to parse:

// UserProfile represents the user profile
type UserProfile struct {
	ID          int32             `json:"id"`
	Email       string            `json:"email"`
	Name        null.Val[string]  `json:"name"`
	Phone       null.Val[string]  `json:"phone"`
	Avatar      null.Val[string]  `json:"avatar"`
	Roles       []rbac.Role       `json:"roles"`
	Permissions []rbac.Permission `json:"permissions"`
}

But updating it to this, it parses fine:

type roles []rbac.Role
type permissions []rbac.Permission
type nullstring null.Val[string]

// UserProfile represents the user profile
type UserProfile struct {
	ID          int32       `json:"id"`
	Email       string      `json:"email"`
	Name        nullstring  `json:"name"`
	Phone       nullstring  `json:"phone"`
	Avatar      nullstring  `json:"avatar"`
	Roles       roles       `json:"roles"`
	Permissions permissions `json:"permissions"`
}

Unfortunately, refactoring to use typed values like this won't work for me since I have a bunch of generated models.

@qequ qequ added the bug Something isn't working label Sep 23, 2024
@qequ
Copy link
Collaborator

qequ commented Sep 23, 2024

hi, thanks for the report. gonna check it out

@is-savitar
Copy link

is-savitar commented Nov 8, 2024

fixed? @qequ

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants