chore: Bump app version to v1.0.1#17
Open
wreckage0907 wants to merge 17 commits into
Open
Conversation
- Fix response schema/example mismatch by wrapping examples in {"message": ...}
- Fix requestBody required flag to be based on actual required fields, not always True
- Fix security requirements to use OR logic instead of AND logic
- Improve Union type handling with proper oneOf/anyOf schemas for complex unions
- Improve PEP 604 union handling to support nested unions properly
- Remove docstring override of signature-based required/optional parameter logic
- Gate demo endpoints behind developer mode or config flag for production security
All fixes address the specific issues identified in the GitHub Copilot review.
…sing - add _PLACEHOLDER_TYPE_MAP and _parse_typed_block to handle <type> annotations in docstring Returns blocks - update extract_returns_from_docstring to detect <type> placeholders and return __placeholder_schema__ sentinel - update build_response_schema to convert __placeholder_schema__ into proper OpenAPI object schema with typed properties - fix example generation to produce typed defaults from placeholder schemas instead of serialising raw sentinel - add full Union / X|Y|None handling in get_openapi_type for Python 3.10+ union syntax - parse multi-line parameter descriptions in parse_docstring_args - only add requestBody when parameters exist; set required flag only when required params are present - delete stale spec JSON files for apps that are disabled in OpenAPI Settings
Modernize UI and add better API search capabilities
- fix None return annotation to emit {nullable: true} instead of {type: string, nullable: true}
- replace shallow non-nested brace regex with balanced-brace extractor so nested JSON in Returns blocks parses correctly
- remove dead pass block that was never executing docstring-required override logic
- remove allow_guest=True from demo_create_item, demo_update_item, demo_delete_item which enforce System Manager; spec now correctly includes auth requirements
- fix demo_authenticated to always return metadata: {} so runtime matches docstring example and schema inference
- add SVG favicon via head_include block so it is correctly injected into <head> (fixes invisible favicon from body placement)
- set document.title dynamically to '<App Title> | Docs' on app load and app switch using Jinja-populated appTitles map
Fix parameter type parsing and modernize ui
Bump app version to v0.1.0
Fix parameter types, improve OpenAPI spec generation and UI
Contributor
|
@wreckage0907 Can you branch out new pr from hotfix branch? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This pull request introduces several improvements to the
frappe-openapiapp, focusing on enhancing documentation, providing comprehensive sample API endpoints, and updating versioning. The most significant change is the addition of a newexamples.pymodule containing a suite of demonstration API endpoints, which will help users understand and test the OpenAPI generator's capabilities. The README has also been revamped for clarity and better onboarding.Documentation and onboarding improvements:
README.mdto include a project logo, feature list, improved installation instructions, clearer usage steps, and updated licensing information. The documentation now better guides new users through setup and API whitelisting best practices.Sample API endpoints:
frappe_openapi/api/examples.py, which provides a comprehensive set of sample API endpoints. These endpoints demonstrate various OpenAPI features, including authentication, parameter types, HTTP methods, and response schemas. The code includes detailed docstrings to serve as references for documentation generation.Versioning:
frappe_openapi/__init__.pyfrom1.0.0to1.0.1to reflect the new features and improvements.