Skip to content

Conversation

disberd
Copy link

@disberd disberd commented Jun 10, 2023

I started trying out this package to interact with the GitLab API on a self-hosted instance and encountered an error when trying to use the 2 argument @json macro to add things endpoints and types to the GitLabAPI.

I believe the type check in the 2 argument @json macro is wrong, as the APIs seems to be of type Forge rather than ForgeType.

This is based on the 1 argument definition of @json (which calls the same 2-argument function json as the 2-argument macro):

macro json(def::Expr)
forge = try
getfield(__module__, Symbol(string(nameof(__module__)) * "API"))
catch
throw("No forge struct named $forge. Make one or pass $(__module__)'s forge struct to @json $(def.args[2])")
end
json(forge, def)
end

which simply extracts the struct $(ModuleName)API which always seems of type Forge rather than ForgeType:

@disberd
Copy link
Author

disberd commented May 1, 2024

@christopher-dG, could check if this can be merged or point me to someone else for review?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant