Repository navigation
Version 0.10.0: the 70 models no operation reaches are removed - #18
Merged
Merged
Conversation
No method of either client takes or returns them, directly or in a field. The public document of API 1.20.11 does not define them. Most came in 0.2.2 and 0.2.3 from the admin console and the dashboard sign-in of the server's own document. The saved spec drops the same 70 schemas and keeps the 174 that the public operations reach. gen_models.py now models only a schema that an operation reaches, the rule the public document is curated by. tests/test_removed_models.py fails when one of the 70 is back in the package or the spec. The CHANGELOG lists all 70 under Removed. The README says how the spec and the generator work now.
The meaning of each line is unchanged. One README sentence of 33 words is split in two. Three lines read "API key" where the lint took "key" for an adjective. A semicolon in the 0.2.4 entry becomes a full stop.
The comment said the admin schemas point at a model the clients use. None of them does. Only Accepted and the sign-in Me did.
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.
0.10.0 stops shipping the old admin and analytics schemas as public models. It follows API 1.20.11, as 0.9.1 did. No client method, argument or return type changed.
Which models, and how they were found
faxforagents.modelshad 244 models. An AST walk ofclient.pyandasync_client.pyfinds 133 of them named asm.<Name>, the same 133 in both. With the models those reach through their fields, that is 156.The public document of API 1.20.11 (faxforagents/openapi at e5d64d8) defines 174 schemas. The saved spec had those 174 and 70 more, and none of the 70 is among the 156. A third view agrees. Following every
$reffrom the 163 operations of the saved spec reaches exactly the 174.The older server documents vendored in the openapi repository show where each of the 70 was used:
/v1/admin, the admin console, analytics included/v1/auth, the dashboard sign-in/v1/oauth/authorizations, the consent calls/webhooksInboxItem,InboxItemSummaryandMe, which stay64 came in with 0.2.2 and 6 with 0.2.3. The CHANGELOG lists all 70 by name under "Removed".
What changed
spec/openapi.yamldrops the 70 schemas, one block at the end ofcomponents.schemas. Parsed, the new file equals the old one without those 70 keys.models.pyis regenerated, and the 174 kept classes are byte for byte the same. OnlyOrganizationSummarymoved, becauseAcceptedno longer pulls it to the top.scripts/gen_models.pywrites a model only for a schema that an operation reaches.curate.pybuilds the public document by the same rule. So a refresh that brings the server's own schemas back still leaves them out ofmodels.py.tests/test_removed_models.pyfails when one of the 70 is back infaxforagents.modelsor the generator would model one. It also fails when the saved spec holds a schema that no operation reaches.The version is 0.10.0 in
pyproject.tomland__init__.py. The README says how the spec and the generator work now.A second commit rewords five older README and CHANGELOG lines, so every prose line passes the human-writing lint (docs channel). The brand header is unchanged. The lint still flags its HTML, the
align="center"attribute and the link and badge rows.Checked
pytest -q -m "not live": 187 pass, 4 of them new. The live test was not run, since it needs a test key.AdminStatsback in the spec, a removed class added tomodels.pyand the generator without its filter.ruff check src tests,ruff format --check src tests,mypy src,python scripts/gen_models.py --checkandsh scripts/truthcheck.shpass.python -m buildandtwine check --strictpass. The wheel with[cli]installs in a clean venv andfaxforagents versionprints 0.10.0.faxforagents.modelshas 174 names andfrom faxforagents.models import AdminStatsraisesImportError.No workflow file changed. Nothing is merged, tagged, released or published by this pull request.