-
Notifications
You must be signed in to change notification settings - Fork 676
refactor(django-ninja): updated django-ninja implementation #7164
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
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: 0427e53 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Hey @hanspagel I gave some of the required love to this integration. |
|
Someone already reserved the name |
369ecd7 to
0427e53
Compare
|
Wonderful PR, I didn’t have time to test this, and we can start publish (under whatever name) soon, too. I haven’t looked at the code, yet, but can you also make sure to use the new HTML/JS API? Looks like that: <!doctype html>
<html>
<head>
<title>Scalar API Reference</title>
<meta charset="utf-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1" />
</head>
<body>
<div id="app"></div>
<!-- Load the Script -->
<script src="https://cdn.jsdelivr.net/npm/@scalar/api-reference"></script>
<!-- Initialize the Scalar API Reference -->
<script>
Scalar.createApiReference('#app', {
// The URL of the OpenAPI/Swagger document
url: 'https://registry.scalar.com/@scalar/apis/galaxy/latest?format=json',
// Avoid CORS issues
proxyUrl: 'https://proxy.scalar.com',
})
</script>
</body>
</html> |
Problem
Currently, django-ninja is on an old code base with just a few configurations available
Solution
With this PR the sub package gets updated
Checklist
I've gone through the following:
pnpm changeset).Note
Refactors the Django Ninja integration to a ScalarConfig-based API with new enums/options, updated rendering, expanded docs, a test suite, packaging updates, and an example playground.
ScalarConfigmodel; addOpenAPISource,SearchHotKey,Theme,DocumentDownloadTypeenums.get_scalar_api_referenceto consumeScalarConfigand initialize viaScalar.createApiReference(...).ScalarViewerto acceptconfigor kwargs (backwards-compatible), defaulting OpenAPI URL.sources), directcontent, document download types, dark mode controls, search hotkeys, auth, servers, layout, theme, and various display toggles.documentation/integrations/django-ninja.md.tests/) covering enums, models, HTML generation, config serialization, and integration withNinjaAPI; addrun_tests.pyand test requirements.playground/demonstrating custom theming and endpoints.setup.py; addpackage.json,MANIFEST.in, adjustrequirements.txt, and prune tests from package.scalar-django-ninja.Written by Cursor Bugbot for commit 0427e53. This will update automatically on new commits. Configure here.