pagination-and-schema
Shape GeoJSON pagination responses and OpenAPI schemas with GeoJsonPagination and GeoFeatureAutoSchema, including geometry, bbox, nested, and list serializers.
- License 许可
- MIT
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- pagination-and-schema
- license
- MIT
- metadata
- { "disco-role": "operating" }
- description
- Shape GeoJSON pagination responses and OpenAPI schemas with GeoJsonPagination and GeoFeatureAutoSchema, including geometry, bbox, nested, and list serializers.
- disable-model-invocation
- true
02 资源文件 3
- 参考文档references/api-reference.md8.8 KB
- 参考文档references/troubleshooting.md7.0 KB
- 参考文档references/workflows.md7.1 KB
03 SKILL.md 正文
Pagination and schema
Load this skill when a DRF GIS endpoint needs a paginated GeoJSON response, an OpenAPI description of a GeoJSON feature, or schema troubleshooting for nested or computed geometries. Keep the wire payload and the generated OpenAPI schema as two separate contracts; a correct response does not prove that the schema is correct.
Operating path
- Identify the serializer at the endpoint boundary and whether DRF is
serializing one object,
many=True, or a nested/list field. - For a paginated feature list, subclass or configure
rest_framework_gis.pagination.GeoJsonPagination. It is aPageNumberPaginationsubclass, acceptspage_sizeas its page-size query parameter, and expects the serialized page data to containfeatures. Confirm the response hastype,count,next,previous, andfeatures; do not substitute DRF's ordinaryresultspayload. - For OpenAPI, configure
rest_framework_gis.schema.GeoFeatureAutoSchemaas DRF's schema class, or pass it explicitly to the schema generator. Verify the generated document independently of a live response. The pagination schema renames the inheritedresultsproperty tofeaturesand adds theFeatureCollectiontype property; inspect version-specificrequiredmetadata as well. - Use the geometry and nesting rules in
references/api-reference.mdrather than copying large coordinate schemas into an endpoint skill. Treat aGeometrySerializerMethodFieldused as the geometry source, or an unsupported custom geometry field, as an explicit schema limitation: the mapper warns and returns an empty geometry schema. - Route serializer
Metaoptions, GeoJSON input flattening, output property ownership, and coordinate transformation details toserialization. Route runtime spatial filters and their query semantics tospatial-filtering. Route Django/DRF settings, schema endpoint wiring, and database-backed integration checks tointegration-testing.
Verification contract
Check both artifacts:
- Serialize representative objects and assert the actual Feature or FeatureCollection envelope, including bbox when configured.
- Generate OpenAPI with the same serializer/view and assert the geometry type, coordinate nesting, Feature/FeatureCollection wrappers, bbox, nested/list placement, and pagination property names.
- Run the method-field and unsupported-custom-field cases while capturing the expected warning; an empty schema is safer than inventing a geometry shape.
- Record the DRF version because schema base output varies across supported
DRF versions (the package supports
>=3.12,<3.19).
The documented inspection scope has verified package imports and geometry smoke with GeoDjango's GEOS/GDAL libraries. Database-backed spatial predicates require a spatial database; PostGIS is the CI-tested full path, but PostGIS execution is not claimed by this skill.
See:
- API reference for payload keys, schema shapes, geometry nesting, bbox, and version notes.
- Workflows for endpoint setup and paired response / schema checks.
- Troubleshooting for schema drift, warnings, nested serializers, and backend limits.
04 同仓库更多 Skills
passnet-triton-opt
Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.
passnet-solve
END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.
passnet-skill
PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.
passnet-pattern-fusion
Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.
passnet-orchestrate
Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.
passnet-feedback
Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).