Skip to content

Instantly share code, notes, and snippets.

@vishwac09
Created February 25, 2022 10:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vishwac09/6249608fbc8f860ea4ba8e82df84a7ac to your computer and use it in GitHub Desktop.
Save vishwac09/6249608fbc8f860ea4ba8e82df84a7ac to your computer and use it in GitHub Desktop.
VehicleCreateSchema
<?php
class VehicleCreateSchema {
// Schema file to validate POST request.
public function getCreateSchema() {
return (object) [
"type" => "object",
"properties" => (object) [
"name" => (object) [
"type" => "string",
],
"company" => (object) [
"type" => "string",
],
"manufacture_year" => (object) [
"type" => "number",
],
"mileage" => (object) [
"type" => "number",
],
"transmission_type" => (object) [
"type" => "string",
],
"owner" => (object) [
"type" => "string",
],
"registration_number" => (object) [
"type" => "string",
],
],
"required" => ["name", "company", "manufacture_year", "mileage", "transmission_type"],
];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment