-
Notifications
You must be signed in to change notification settings - Fork 9
feat: v0.1 conformances #90
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
Merged
Merged
Changes from 14 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
ef78f4d
--wip-- [skip ci]
gadomski d248228
wip
gadomski 57267e0
feat: add more conformances
gadomski 4f3316b
Merge branch 'main' into conformance
gadomski d772260
chore: update changelog
gadomski e22c93b
fix: comments
gadomski 87f2dce
Merge branch 'main' into conformance
gadomski 9b5744d
fix: validation script
gadomski e6d0e8b
feat: switch to dataclasses
gadomski 1862d1d
feat: comment
gadomski 564adf0
fix: remove spurious TODO
gadomski 3b4b079
fix: application
gadomski 522a304
Merge branch 'main' into conformance
gadomski 9fef872
Merge branch 'main' into conformance
gadomski f7db6af
fix: relax some checks
gadomski 12644af
proposed rework of conformances
jkeifer 412fd5b
set comparison on conformance tests to ignore order
jkeifer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,40 @@ | ||
| # This is some slightly strange magic to get "static" structures with | ||
| # attributes, to make it pleasant to use in an editor with autocompletion. | ||
|
|
||
| import dataclasses | ||
| from dataclasses import dataclass | ||
|
|
||
| from stapi_pydantic.constants import STAPI_VERSION | ||
|
|
||
| CORE = f"https://stapi.example.com/v{STAPI_VERSION}/core" | ||
| OPPORTUNITIES = f"https://stapi.example.com/v{STAPI_VERSION}/opportunities" | ||
| ASYNC_OPPORTUNITIES = f"https://stapi.example.com/v{STAPI_VERSION}/async-opportunities" | ||
|
|
||
| @dataclass(frozen=True) | ||
| class _All: | ||
| def all(self) -> list[str]: | ||
| return [getattr(self, field.name) for field in dataclasses.fields(self)] | ||
|
|
||
|
|
||
| @dataclass(frozen=True) | ||
| class _Api(_All): | ||
| core: str = f"https://stapi.example.com/v{STAPI_VERSION}/core" | ||
| order_statuses: str = f"https://stapi.example.com/v{STAPI_VERSION}/order-statuses" | ||
| searches_opportunity: str = f"https://stapi.example.com/v{STAPI_VERSION}/searches-opportunity" | ||
| searches_opportunity_statuses: str = f"https://stapi.example.com/v{STAPI_VERSION}/searches-opportunity-statuses" | ||
|
|
||
|
|
||
| @dataclass(frozen=True) | ||
| class _Product(_All): | ||
| opportunities: str = f"https://stapi.example.com/v{STAPI_VERSION}/opportunities" | ||
| opportunities_async: str = f"https://stapi.example.com/v{STAPI_VERSION}/opportunities-async" | ||
| geojson_point: str = "https://geojson.org/schema/Point.json" | ||
| geojson_linestring: str = "https://geojson.org/schema/LineString.json" | ||
| geojson_polygon: str = "https://geojson.org/schema/Polygon.json" | ||
| geojson_multi_point: str = "https://geojson.org/schema/MultiPoint.json" | ||
| geojson_multi_polygon: str = "https://geojson.org/schema/MultiPolygon.json" | ||
| geojson_multi_linestring: str = "https://geojson.org/schema/MultiLineString.json" | ||
|
|
||
|
|
||
| API = _Api() | ||
| """API (top level) conformances""" | ||
|
|
||
| PRODUCT = _Product() | ||
| """Product conformances""" |
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
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
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
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
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
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
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
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
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.
Uh oh!
There was an error while loading. Please reload this page.