Skip to content
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

Openapi dev #21

Merged
merged 2 commits into from
Jan 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions arrest/openapi/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ def generate_resource_file(
) -> list[ResourceSchema]:
resources = list(self._build_arrest_resources(openapi=openapi))
path, _ = os.path.splitext(schema_path)
module = path.split("/")[-1]
module = Path(path).stem

ResourceTemplate(
schema_module=module, resources=resources, destination_path=resource_path
Expand Down Expand Up @@ -236,7 +236,6 @@ def get_request_schema(self, operation: Operation) -> Optional[str]:
return get_ref_schema(media.media_type_schema)

def get_response_schema(self, operation: Operation) -> Optional[str]:
print(operation.responses)
if not operation.responses or not (
success_response := operation.responses.get(str(httpx.codes.OK), None)
):
Expand Down
1 change: 0 additions & 1 deletion arrest/openapi/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@


def get_ref_schema(reference: Reference | Any) -> str | None:
print(f"{reference=}")
if ref := getattr(reference, "ref", None):
return ref.split("/")[-1]

Expand Down
Loading
Loading