I work a lot with these design time formats, more RAML than OpenAPI but chose the second because it fit a little better with what I wanted to provide. This should provide a lot of reuse and minimal friction if adopting phtal.
If I understand your question about request markup correctly the answer is that is up to the client informed by the profile what is sent and to the server what's actually done.
Consider the following interaction:
GET
clinic.com/Accept: app/phtal+json
200: OK
Content-Type: app/phtal+json;profile="
profile.com/clinic"
{
"clinicName": "best clinic",
"_links": {
"
rels.com/registerPatientService": {
"href": ...
"instructions": {"http": {
"method": "post",
"consumes": "app/json;profile="
profiles.com/fhir-patient";q=0.5,
app/json;profile="
profiles.com/myclinic-patient-form";q=1.0",
"produces": "app/json;profile="
profiles.com/fhir-operationOutcome""
}}
}
}
}
profiles.com/myclinic-patient-form could resolve to phtal profile that'd include
description: This represents myclinic's patient registration form in json. "Some other information...."
schema: ...
examples: ...
basically a light weight standalone media type imo. This teaches the client the semantics behind a profiled representation and the schema for composing it. Which would enable it to...
POST ...
Content-Type: app/json;profile="
profiles.com/myclinic-patient-form"
Accept: app/json;profile="
profiles.com/fhir-operationOutcome"
{
"patientName": "some name",
"age": ...,
"condition": "
conditions.com/common-cold"
}
In this scenario the request would not include any hypermedia markup, any URIs needed by the server could be a regular json field in the request to be parsed by the server and then associated with a link. So the body of the request would seemingly be a regular hypermedia-less json or xml request, with the important difference that the media type metadata ie. phtal profile in content-type header, would identify the semantics and schema of the data for validating and parsing. In my experience that regular json or xml request is exactly how most "rest" apis work today, so there would be minimal friction there in adopting phtal.
coninuing the scenario...
201: Created
Content-Type: app/phtal+json;profile="
profile.com/fhir-operationOutcome"
{
"id": "allok",
"text": {
"status": "generated"
},
"issue": [
{
"severity": "information",
"code": "informational",
"details": {
"text": "All OK"
}
}
],
"_links": {
"
rels.com/patient": {
"href": "
clinic.com/patient/123",
"instructions": {"http": {
"produces": "app/phtal+json;profile="
profile.com/fhir-patient""
}}
}
}
}
GET
clinic.com/patient/123Accept: app/phtal+json;profile="
profile.com/fhir-patient"
200: OK
Content-Type: app/phtal+json;profile="
profile.com/fhir-patient"
{
"patientName": "some name",
"_links": {
"
rels.com/condition": {
"href": "
conditions.com/common-cold",
"instructions": {"http": {
"produces": "app/json;profile="
profiles.com/condition""
}}
}
},
"_methods": { "http": {
"put": {
"consumes": "app/json;profile="
profiles.com/fhir-patient";q=0.5,
app/json;profile="
profiles.com/myclinic-patient-form";q=1.0",
"produces": "app/json;profile="
profiles.com/fhir-operationOutcome""
}
}
}
}
In this case the client has two request options for an HTTP PUT. The form we used in the first scenario to create the patient, which the server would probably process the same just specifically to the already existing patient, internally transform it into what ends up being hypermedia enabled format for a subsequent GET.
Or the hypermedia enabled format being presented currently "
profiles.com/fhir-patient", I think here it's entirely up to the client and server what might happen, the client can choose to include the links it wants in the phtal format and the server is free to accept as is, transform that information however it sees fit, or reject it if something is not right. Both of those options I think are entirely consistent with HTTP PUT.
I would imagine the second scenario ought to be successful more often when done through code-on-demand, which I hope to add to phtal, because it'd know exactly what rels and values are supported internally.
I may have rambled a bit. Did that make sense?