Skip to content

Commit

Permalink
JSON-schema for public 5.199
Browse files Browse the repository at this point in the history
  • Loading branch information
vkcom authored and VKAdminU committed Dec 19, 2024
1 parent cf3d2d0 commit 73dd29e
Show file tree
Hide file tree
Showing 26 changed files with 730 additions and 244 deletions.
73 changes: 73 additions & 0 deletions .github/workflows/php-sdk-generate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: php-sdk-generate

on:
push:
branches:
- master

jobs:
build:
runs-on: ubuntu-latest
environment: production
steps:
- name: Prepare generate
run:
echo SCHEMA_COMMENT=\"${{ github.event.head_commit.message }}\" >> $GITHUB_ENV

- name: Checkout generator
uses: actions/checkout@v4
with:
fetch-depth: 1
repository: ${{ vars.SDK_GENERATOR_REPO }}
token: ${{ secrets.PHP_SDK_TOKEN }}

- name: Checkout json schema
uses: actions/checkout@v4
with:
fetch-depth: 1
path: schema/

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ vars.PHP_VERSION }}
extensions: mbstring, intl
ini-values: post_max_size=256M, max_execution_time=180
tools: composer:v2
env:
fail-fast: true

- name: Run generator
run: |
touch .env
echo NAME=\"${{ vars.NAME }}\" >> .env
echo DESCRIPTION=\"${{ vars.DESCRIPTION }}\" >> .env
echo LICENSE=\"${{ vars.LICENSE }}\" >> .env
echo PHP_VERSION=\"${{ vars.PHP_VERSION }}\" >> .env
echo USER_AGENT=\"${{ vars.USER_AGENT }}\" >> .env
echo SCHEMA_DIRECTORY=\"schema/\" >> .env
echo SDK_REPO=\"${{ vars.SDK_REPO }}\" >> .env
echo HOMEPAGE=\"${{ vars.HOMEPAGE }}\" >> .env
cat .env
composer install
composer sdk:build
- name: Prepare php-sdk
uses: actions/checkout@v4
with:
fetch-depth: 1
repository: ${{ vars.SDK_REPO }}
path: php-sdk
token: ${{ secrets.PHP_SDK_TOKEN }}

- name: Run generator
shell: bash {0}
run: |
cd php-sdk
find . -path ./.git -prune -o -exec rm -rfv {} \; 2> /dev/null
cp -r ../generated/* .
git add .
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git commit -m "Autogenerate sdk on $SCHEMA_COMMENT"
git push
4 changes: 4 additions & 0 deletions account/methods.json
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,10 @@
"name": "sandbox",
"type": "boolean",
"default": 0
},
{
"name": "pushes_granted",
"type": "boolean"
}
],
"responses": {
Expand Down
6 changes: 4 additions & 2 deletions account/objects.json
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,8 @@
"description": "Settings parameters",
"enum": [
"on",
"off"
"off",
"no_sound"
]
},
"account_push_params_settings": {
Expand All @@ -409,7 +410,8 @@
"enum": [
"on",
"off",
"fr_of_fr"
"fr_of_fr",
"no_sound"
]
},
"account_push_settings": {
Expand Down
17 changes: 8 additions & 9 deletions ads/objects.json
Original file line number Diff line number Diff line change
Expand Up @@ -646,8 +646,7 @@
},
"ord_data": {
"description": "Ord data",
"$ref": "../ads/objects.json#/definitions/ads_ord_data",
"required": false
"$ref": "../ads/objects.json#/definitions/ads_ord_data"
}
}
},
Expand Down Expand Up @@ -1102,8 +1101,7 @@
"description": "Used requests per user",
"items": {
"$ref": "../ads/objects.json#/definitions/ads_flood_stats_by_user_item"
},
"required": false
}
}
}
},
Expand Down Expand Up @@ -1293,15 +1291,17 @@
"required": true
},
"inn": {
"type": "string",
"required": false
"type": "string"
},
"phone": {
"type": "string",
"required": true
},
"agency_phone": {
"type": "string",
"required": false
},
"subagent": {
"required": false,
"$ref": "../ads/objects.json#/definitions/ads_ord_subagent"
},
"contract_number": {
Expand Down Expand Up @@ -1338,8 +1338,7 @@
"required": true
},
"inn": {
"type": "string",
"required": false
"type": "string"
},
"phone": {
"type": "string",
Expand Down
6 changes: 6 additions & 0 deletions audio/objects.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@
"performer": {
"type": "string",
"description": "Performer name"
},
"file_size": {
"type": "integer",
"format": "int64",
"minimum": 0,
"description": "Примерный объем памяти занимаемый аудио на устройстве. Реализовано только для эпизодов подкастов"
}
}
}
Expand Down
17 changes: 15 additions & 2 deletions base/objects.json
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,7 @@
"market_clear_recent_queries",
"close_web_app",
"open_search_tab",
"open_search_filters",
"import_contacts",
"add_friends",
"onboarding",
Expand All @@ -489,7 +490,13 @@
"secondary",
"tertiary",
"float_bottom",
"outline_with_chevron"
"cell_button_centered_icon",
"borderless_with_icon",
"gray",
"flat",
"outline_with_chevron",
"inline",
"modal"
],
"enumNames": [
"updates",
Expand All @@ -498,7 +505,13 @@
"secondary",
"tertiary",
"float_bottom",
"outline_with_chevron"
"cell_button_centered_icon",
"borderless_with_icon",
"gray",
"flat",
"outline_with_chevron",
"inline",
"modal"
]
},
"base_link_no_product": {
Expand Down
4 changes: 4 additions & 0 deletions bugtracker/methods.json
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,10 @@
"name": "hidden",
"type": "boolean"
},
{
"name": "hidden_attachments",
"type": "boolean"
},
{
"name": "force",
"type": "boolean"
Expand Down
25 changes: 25 additions & 0 deletions bugtracker/objects.json
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,9 @@
"hidden_docs": {
"type": "boolean"
},
"is_confidential": {
"type": "boolean"
},
"private_comment": {
"type": "string"
},
Expand All @@ -163,6 +166,25 @@
"moderated": {
"type": "integer",
"minimum": 0
},
"screen_reader": {
"type": "integer",
"minimum": 0
},
"status_auto_update_ts": {
"type": "integer",
"minimum": 0
},
"status_auto_update_reason": {
"type": "integer",
"enum": [
1,
2
],
"enumNames": [
"need_correction_long_time",
"ready_for_testing_long_time"
]
}
}
},
Expand Down Expand Up @@ -235,6 +257,9 @@
},
"author": {
"$ref": "../bugtracker/objects.json#/definitions/bugtracker_comment_author"
},
"is_attachments_hidden": {
"type": "boolean"
}
}
},
Expand Down
Loading

0 comments on commit 73dd29e

Please sign in to comment.