This exercise is designed to help you learn about the extensible data schema in OJS/OMP/OPS.
💡 Only some entities have a JSON schema definition, but our plan is to refactor the code so that all entities use the schema system.
Review the section on entity schemas in the developer documentation and then find the announcement schema’s JSON file.
Use what you have learned to add a new property, keyword
, to the announcement entity. Add validation rules for the property so that it can only be one of the following: apple
, banana
, or cherry
.
Use one of the following methods to update the announcements you created in Exercise 3 with keywords:
/api/v1/announcements/<announcement_id>
.PKP\components\forms\announcement\PKPAnnouncementForm
to add a text field for entering a keyword
. Then use the UI to edit an announcement and enter a keyword.Finally, update the announcements page you created in Exercise 3 to show the keyword.
http://localhost:8000/index.php/publicknowledge/example/announcements
I can see the keyword for any announcements where I entered one.apple
, banana
, or cherry
, I see an error message.