Skip to content

fix(girest): Allow generation of generic endpoints for structs without methods#57

Open
sanchezcarballlido wants to merge 1 commit into
mainfrom
fix/girest-missing-struct-endpoints
Open

fix(girest): Allow generation of generic endpoints for structs without methods#57
sanchezcarballlido wants to merge 1 commit into
mainfrom
fix/girest-missing-struct-endpoints

Conversation

@sanchezcarballlido
Copy link
Copy Markdown
Contributor

Summary

This PR fixes an issue where API endpoints for certain structs (specifically containers like GLib.SList and GLib.List) were missing from the generated schema in some environments.

The Problem

In girest/main.py, the _generate_struct function included an optimization check if n_methods == 0: return. This caused the generator to abort processing immediately if a struct had no introspectable methods, skipping the logic to generate generic constructors (new) and destructors (free) that exists later in the function.

The Fix

Removed the early return check. The generator now proceeds to evaluate if generic lifecycle endpoints are needed, regardless of the method count.

Verification

  • Confirmed that endpoints for GLib.SList and GLib.List are now correctly generated.

… methods

Previously, '_generate_struct' returned early if 'n_methods == 0'. This prevented the generation of generic 'new' and 'free' endpoints for structs like 'GLib.SList' or 'GLib.List' that may not have exposed methods in certain environments. Removing the early return ensures these lifecycle endpoints are always created.
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