Skip to content
This repository has been archived by the owner on Jan 18, 2025. It is now read-only.

Commit

Permalink
fix: schema config
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinNitroG committed Jan 10, 2025
1 parent fe41fc0 commit dd1aa79
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 25 deletions.
5 changes: 3 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,9 @@ repos:
rev: 0.30.0
hooks:
- id: check-github-workflows
- id: check-metaschema
files: config.sample.json
- id: check-jsonschema
files: '^(check-phat-nguoi)?(\.)?config(\.)?(sample)?\.json$'
args: ['--schemafile', 'schemas/config.json']

- repo: https://github.com/astral-sh/uv-pre-commit
rev: 0.5.14
Expand Down
4 changes: 2 additions & 2 deletions config.sample.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
"enabled": true
}
],
"havent_paid_only": true,
"verbose": true,
"pending_fines_only": true,
"detail": true,
"detail_log": false,
"log_level": "INFO"
}
34 changes: 17 additions & 17 deletions schemas/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,23 +22,6 @@
"title": "Biển số",
"type": "string"
},
"owner": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Ghi chú chủ sở hữu (phù hợp khi dùng nhắc ai đó với lựa chọn notifications)",
"examples": [
"@kevinnitro",
"dad"
],
"title": "Ghi chú chủ sở hữu"
},
"type": {
"anyOf": [
{
Expand All @@ -56,6 +39,23 @@
"description": "Loại phương tiện để gửi request cũng như lọc loại phương tiện đối với các API không lọc loại phương tiện sẵn",
"title": "Loại phương tiện"
},
"owner": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"description": "Ghi chú chủ sở hữu (phù hợp khi dùng nhắc ai đó với lựa chọn notifications)",
"examples": [
"@kevinnitro",
"dad"
],
"title": "Ghi chú chủ sở hữu"
},
"api": {
"anyOf": [
{
Expand Down
8 changes: 4 additions & 4 deletions src/check_phat_nguoi/config/models/plate_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@ class PlateInfo(BaseModel):
title="Biển số",
examples=["60A64685", "98-A-56604", "30-F88251", "59XB-00000"],
)
type: VehicleStrType | VehicleTypeEnum = Field(
description="Loại phương tiện để gửi request cũng như lọc loại phương tiện đối với các API không lọc loại phương tiện sẵn",
title="Loại phương tiện",
)
owner: str | None = Field(
description="Ghi chú chủ sở hữu (phù hợp khi dùng nhắc ai đó với lựa chọn notifications)",
title="Ghi chú chủ sở hữu",
examples=["@kevinnitro", "dad"],
default=None,
)
type: VehicleStrType | VehicleTypeEnum = Field(
description="Loại phương tiện để gửi request cũng như lọc loại phương tiện đối với các API không lọc loại phương tiện sẵn",
title="Loại phương tiện",
)
api: ApiEnum | None = Field(
description="Sử dụng API từ trang web nào (để trống sẽ sử dụng API define ở scope ngoài)",
title="API",
Expand Down

0 comments on commit dd1aa79

Please sign in to comment.