Skip to content

Competition

Base model for a competition.

A competition is an application process for a funding opportunity. It often has a distinct application period and set of application forms.

From v0.5, a competition links to its opportunity with opportunity, an OppRef carrying the opportunity’s id and title, in place of the bare opportunityId used through v0.4. A payload for any one version never carries both; only TypeSpec source examples do (see Authoring in TypeSpec).

The table and the example below show the v0.5 payload. To validate a payload, use the OpenAPI document for its version, such as /openapi/openapi.0.5.0.yaml, also browsable on the API docs page.

PropertyTypeRequiredDescription
iduuidYesGlobally unique id for the competition
opportunityOppRefYesThe opportunity this competition is for
titlestringYesThe title of the competition
descriptionstringNoThe description of the competition
instructionsstring or array<File>NoThe instructions for the competition
statusCompetitionStatusYesThe status of the competition
keyDatesCompetitionTimelineNoThe key dates in the competition timeline
formsCompetitionFormsYesThe forms for the competition
acceptedApplicantTypesarray<ApplicantType>NoAccepted applicant types for the competition
customFieldsrecord<CustomField>NoThe custom fields for the competition
createdAtutcDateTimeYesThe timestamp (in UTC) at which the record was created.
lastModifiedAtutcDateTimeYesThe timestamp (in UTC) at which the record was last modified.

The JSON Schema tab shows the unversioned authoring schema, not a v0.5 payload schema. It combines every version’s fields, so it requires both opportunityId and opportunity.

A JSON example of this model.

{
"id": "b7c1e2f4-8a3d-4e2a-9c5b-1f2e3d4c5b6a",
"opportunity": {
"id": "b7c1e2f4-8a3d-4e2a-9c5b-1f2e3d4c5b6b",
"title": "Small business grant program"
},
"title": "Competition 1",
"description": "Competition 1 description",
"instructions": "Competition 1 instructions",
"status": {
"value": "open",
"description": "Competition is open for applications"
},
"keyDates": {
"openDate": {
"name": "Open Date",
"eventType": "singleDate",
"date": "2025-01-01"
},
"closeDate": {
"name": "Close Date",
"eventType": "singleDate",
"date": "2025-01-30"
},
"otherDates": {
"reviewPeriod": {
"name": "Application Review Period",
"eventType": "dateRange",
"startDate": "2025-02-01",
"endDate": "2025-02-28"
}
}
},
"forms": {
"forms": {
"formA": {
"id": "c1d2e3f4-5a6b-4c7d-8e9f-0a1b2c3d4e5f",
"title": "Form A",
"createdAt": "2025-01-01T00:00:00Z",
"lastModifiedAt": "2025-01-01T00:00:00Z"
},
"formB": {
"id": "c1d2e3f4-5a6b-4c7d-8e9f-0a1b2c3d4e60",
"title": "Form B",
"createdAt": "2025-01-01T00:00:00Z",
"lastModifiedAt": "2025-01-01T00:00:00Z"
}
},
"validation": {
"required": ["formA"]
}
},
"createdAt": "2025-01-01T00:00:00Z",
"lastModifiedAt": "2025-01-01T00:00:00Z"
}
VersionChangesSchema
0.5.0
  • Removed opportunityId field
  • Added opportunity field
CompetitionBase.yaml
0.2.0
  • Added CompetitionBase model
CompetitionBase.yaml
Version Field Type
v0.4 and earlier opportunityId uuid, required
v0.5 opportunity OppRef, required
  • Producers: replace opportunityId with an opportunity object. Its id is the value you sent as opportunityId, and its title is the linked opportunity’s title, so you need that title at hand when you serialize a competition. identifiers is optional.
  • Consumers: read the opportunity’s id from opportunity.id. Its title arrives with it, so displaying the opportunity no longer needs a second request.
  • Applications are unaffected: ApplicationBase keeps its competitionId and opportunityId fields.
  • Nested forms change too: v0.5 replaces each nested form’s name with title. See migrating forms.

v0.4 and earlier:

{
"id": "b7c1e2f4-8a3d-4e2a-9c5b-1f2e3d4c5b6a",
"opportunityId": "b7c1e2f4-8a3d-4e2a-9c5b-1f2e3d4c5b6b",
"title": "Competition 1"
}

v0.5:

{
"id": "b7c1e2f4-8a3d-4e2a-9c5b-1f2e3d4c5b6a",
"opportunity": {
"id": "b7c1e2f4-8a3d-4e2a-9c5b-1f2e3d4c5b6b",
"title": "Small business grant program"
},
"title": "Competition 1"
}

Both excerpts omit the other required fields.

The TypeSpec model declares every version’s fields at once: opportunityId is removed in v0.5 and opportunity added in v0.5, so the changelog records a removal and an addition, and the unversioned model requires both.

  • Examples: an @example for CompetitionBase, or for a model that embeds a competition, must set both opportunityId and opportunity, even in a project pinned to an earlier version, and should give opportunity.id the same value as opportunityId. Its nested forms also need both name and title (see authoring forms in TypeSpec). The compiler checks examples against the unversioned model; each version’s OpenAPI output keeps only the field that version declares.
  • The unversioned JSON Schema, /schemas/yaml/CompetitionBase.yaml (the JSON Schema tab above), is that combined model, so it requires both fields. No single version’s payload satisfies it; validate a payload with the OpenAPI document for its version.

The status of the competition.

PropertyTypeRequiredDescription
valueCompetitionStatusOptionsYesThe selected value, from a predefined set of options
customValuestringNoA custom value, used when the selected value is the `custom` option
descriptionstringNoA human-readable description of the value

A JSON example of this model.

{
"value": "custom",
"customValue": "canceled",
"description": "Competition has been canceled"
}
VersionChangesSchema
0.2.0
  • Added CompetitionStatus model
CompetitionStatus.yaml

Enumeration of possible competition status values.

ValueDescription
openThe competition is open for applications
closedThe competition is no longer accepting applications
customA custom status

A JSON example of this model.

"open"
VersionChangesSchema
0.2.0
  • Added CompetitionStatusOptions enum
CompetitionStatusOptions.yaml

Set of forms that need to be completed to apply to the competition.

PropertyTypeRequiredDescription
formsrecord<FormBase>YesThe forms for the competition
validationrecordNoThe validation rules for the competition forms

A JSON example of this model.

{
"forms": {
"formA": {
"id": "c1d2e3f4-5a6b-4c7d-8e9f-0a1b2c3d4e5f",
"title": "Form A",
"createdAt": "2025-01-01T00:00:00Z",
"lastModifiedAt": "2025-01-01T00:00:00Z"
},
"formB": {
"id": "c1d2e3f4-5a6b-4c7d-8e9f-0a1b2c3d4e60",
"title": "Form B",
"createdAt": "2025-01-01T00:00:00Z",
"lastModifiedAt": "2025-01-01T00:00:00Z"
}
},
"validation": {
"required": ["formA"]
}
}
VersionChangesSchema
0.2.0
  • Added CompetitionForms model
CompetitionForms.yaml

The key dates in the competition’s timeline.

PropertyTypeRequiredDescription
openDateEventNoThe start date of the competition
closeDateEventNoThe end date of the competition
otherDatesrecord<Event>NoThe date the competition was created

A JSON example of this model.

{
"openDate": {
"name": "Open Date",
"eventType": "singleDate",
"date": "2025-01-01"
},
"closeDate": {
"name": "Close Date",
"eventType": "singleDate",
"date": "2025-01-30"
},
"otherDates": {
"reviewPeriod": {
"name": "Application Review Period",
"eventType": "dateRange",
"startDate": "2025-02-01",
"endDate": "2025-02-28"
}
}
}
VersionChangesSchema
0.2.0
  • Added CompetitionTimeline model
CompetitionTimeline.yaml