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.
概要
現状記事に対して違反しているというデータしか持っていないが、
申告者がより詳細に報告をできるよう、APIの受け口を広げました。
追加項目
環境変数(SSMパラメータ)
なし
関連URL
影響範囲(ユーザ)
影響範囲(システム)
技術的変更点概要
なにをどう変更したか
当該APIのリクエストにJSONで受け取れるように受け皿を作り、データ登録時の項目を増やした
memo: 複合条件での入力チェックについて
今回の場合、例えば申告理由が著作権違反の場合は、元記事URLと補足説明を必須にする必要があると考えた。
その複合条件のチェックをjsonschemaでやろうと調べまくったが、結論本家のバージョンdraft-07から開始したらしい。。
(Pythonライブラリのjsonschemaはdraft-6までをサポート)
悲しいが今回は自作しました。
参考URL
https://github.com/Julian/jsonschema
http://json-schema.org/draft-07/json-schema-release-notes.html
https://stackoverflow.com/questions/38717933/jsonschema-attribute-conditionally-required
使い方
DBやDBへのクエリに対する変更
※レビュー通りましたらドキュメントに正式反映いたします
violence(公序良俗に反する)
spam(迷惑行為)
plagiarism(著作権違反)
slander(誹謗中傷)
illegal(トークン不正取得)
other(その他)
ブロックチェーンへの影響
なし
個人情報の取り扱いに変更のあるリリースか
なし
ロギング
なし
ユニットテスト
あり
テスト結果とテスト項目
保留した項目とTODOリスト
なし
注意点・その他