Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use body root to specify which parameter models we want to keep grouped #29483

Merged
merged 34 commits into from
Jun 26, 2024
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
c01768b
add ops.ResourceCollectionAction KeepModel
Jun 18, 2024
cb321f1
add ops.ResourceAction KeepModel
Jun 18, 2024
199803d
add ops.LongRunningResourceAction KeepModel
Jun 18, 2024
c42df35
other templates
Jun 18, 2024
3b6cb5f
switch over to BodyParameter
Jun 19, 2024
038dad8
format
Jun 20, 2024
e0b9e20
use valueof in BodyParameter template, add doc
Jun 20, 2024
ffb91da
Merge branch 'main' of https://github.com/Azure/azure-rest-api-specs …
Jun 20, 2024
f11aea7
remove unnecessary documentation
Jun 20, 2024
d940004
add doc to BodyParameter template
Jun 21, 2024
440d9d1
add extra specs
Jun 21, 2024
40c6515
Merge branch 'main' of https://github.com/Azure/azure-rest-api-specs …
Jun 21, 2024
1d3cba4
fix formatting of BodyParameter
Jun 24, 2024
1727265
format
Jun 24, 2024
d11bb45
Merge branch 'main' of https://github.com/Azure/azure-rest-api-specs …
Jun 24, 2024
ed34a0b
format
Jun 24, 2024
20e479f
format
Jun 24, 2024
ce72061
suppress doc warning
Jun 25, 2024
5e96ec7
Merge branch 'main' of https://github.com/Azure/azure-rest-api-specs …
Jun 25, 2024
be1c649
move body parameter to template
Jun 25, 2024
6c4bb65
add default body parameter doc
Jun 25, 2024
3bc73a2
default bodyparam doc to body parameter
Jun 25, 2024
bd68bb7
fix validation errors
Jun 25, 2024
3ea816d
remove bodyparameter from codetransparency
Jun 25, 2024
fa2f327
try for openai
Jun 25, 2024
8eeabae
remove incorrect alias bodyparameter
Jun 25, 2024
628a3e0
don't spread CreateLivenessWithVerifySessionContent
Jun 25, 2024
a8d0a5b
fix breaking change in easm
Jun 25, 2024
0fa93ff
add readme to openai assistants
Jun 26, 2024
2d89c52
update readme
Jun 26, 2024
b0eecac
add tag to readme
Jun 26, 2024
d7f5eaf
fix json file reference
Jun 26, 2024
a99b0d5
add json files to list
Jun 26, 2024
eed58b8
Merge branch 'main' into body_root_params
markcowl Jun 26, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,7 @@ alias AudioTextResponse = {
@bodyRoot
body: string;
};

model KeepModel<T> {
@bodyRoot body: T;
}
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,7 @@ union ChatRole {
@added(ServiceApiVersions.v2024_02_15_Preview)
tool: "tool",
}

model KeepModel<T> {
@bodyRoot body: T;
}
Original file line number Diff line number Diff line change
Expand Up @@ -102,3 +102,7 @@ model EmbeddingsUsage {
@encodedName("application/json", "total_tokens")
totalTokens: int32;
}

model KeepModel<T> {
@bodyRoot body: T;
}
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,7 @@ op OaiLongRunningRpcOperation<
Traits,
TErrorResponse
>;

model KeepModel<T> {
@bodyRoot body: T;
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ namespace Azure.OpenAI;
@sharedRoute
op getAudioTranscriptionAsPlainText is Azure.Core.ResourceAction<
Deployment,
AudioTranscriptionOptions, // response_format must be one of: text, srt, vtt
KeepModel<AudioTranscriptionOptions>, // response_format must be one of: text, srt, vtt
AudioTextResponse,
MultipartFormDataRequestHeadersTraits & TextPlainResponseHeadersTraits
>;
Expand All @@ -44,7 +44,7 @@ op getAudioTranscriptionAsPlainText is Azure.Core.ResourceAction<
@sharedRoute
op getAudioTranscriptionAsResponseObject is Azure.Core.ResourceAction<
Deployment,
AudioTranscriptionOptions, // response_format must be unspecified (json) or one of: json, verbose_json
KeepModel<AudioTranscriptionOptions>, // response_format must be unspecified (json) or one of: json, verbose_json
AudioTranscription,
MultipartFormDataRequestHeadersTraits
>;
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ namespace Azure.OpenAI;
@sharedRoute
op getAudioTranslationAsPlainText is Azure.Core.ResourceAction<
Deployment,
AudioTranslationOptions, // response_format must be one of: text, srt, vtt
KeepModel<AudioTranslationOptions>, // response_format must be one of: text, srt, vtt
AudioTextResponse,
MultipartFormDataRequestHeadersTraits & TextPlainResponseHeadersTraits
>;
Expand All @@ -42,7 +42,7 @@ op getAudioTranslationAsPlainText is Azure.Core.ResourceAction<
@sharedRoute
op getAudioTranslationAsResponseObject is Azure.Core.ResourceAction<
Deployment,
AudioTranslationOptions, // response_format must be unspecified (json) or one of: json, verbose_json
KeepModel<AudioTranslationOptions>, // response_format must be unspecified (json) or one of: json, verbose_json
AudioTranslation,
MultipartFormDataRequestHeadersTraits
>;
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ namespace Azure.OpenAI;
@action("completions") //@convenientAPI(true)
op getCompletions is Azure.Core.ResourceAction<
Deployment,
CompletionsOptions,
KeepModel<CompletionsOptions>,
Completions
>;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ namespace Azure.OpenAI;
@action("embeddings") //@convenientAPI(true)
op getEmbeddings is Azure.Core.ResourceAction<
Deployment,
EmbeddingsOptions,
KeepModel<EmbeddingsOptions>,
Embeddings
>;
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ namespace Azure.OpenAI;
@action("images/generations")
op getImageGenerations is Azure.Core.ResourceAction<
Deployment,
ImageGenerationOptions,
KeepModel<ImageGenerationOptions>,
ImageGenerations
>;

Expand Down Expand Up @@ -54,7 +54,7 @@ op getAzureBatchImageGenerationOperationStatus is RpcOperation<
}
)
op beginAzureBatchImageGeneration is OaiLongRunningRpcOperation<
ImageGenerationOptions,
KeepModel<ImageGenerationOptions>,
BatchImageGenerationOperationResponse,
BatchImageGenerationOperationResponse
>;
4 changes: 4 additions & 0 deletions specification/communication/Communication.Messages/models.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -374,3 +374,7 @@ enum Versions {
@useDependency(Azure.Core.Versions.v1_0_Preview_2)
c2024_02_01: "2024-02-01",
}

model KeepModel<T> {
@bodyRoot body: T;
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ interface NotificationMessagesOperations {
@doc("Sends a notification message from Business to User.")
send is Operations.ResourceCollectionAction<
Notifications,
NotificationContent,
KeepModel<NotificationContent>,
AcceptedResponse & SendMessageResult
>;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@ using Azure.Core.Traits;
using TypeSpec.Rest;
using TypeSpec.Http;

import "./models.tsp";

namespace Microsoft.CodeTransparency;

#suppress "@azure-tools/typespec-azure-core/use-standard-operations"
@doc("Post an entry to be registered on the CodeTransparency instance.")
@post
@route("/entries")
op createEntry is Foundations.Operation<
CoseEntry,
KeepModel<CoseEntry>,
CreateEntryResult,
ServiceTraits
>;
Expand All @@ -22,7 +24,7 @@ op createEntry is Foundations.Operation<
@doc("Get the status the entry operation")
@route("/operations/{operationId}")
op getEntryStatus is Foundations.Operation<
OperationIdParameter,
KeepModel<OperationIdParameter>,
GetOperationResult,
ServiceTraits
>;
Expand All @@ -40,7 +42,7 @@ op listEntryStatuses is Foundations.Operation<
@doc("Get Entry with or without receipt embedded in its unprotected header")
@route("/entries/{entryId}")
op getEntry is Foundations.Operation<
EmbedReceiptParameter,
KeepModel<EmbedReceiptParameter>,
CoseEntry,
ServiceTraits
>;
Expand All @@ -49,7 +51,7 @@ op getEntry is Foundations.Operation<
@doc("Get the receipt of an entry given a specific entry id.")
@route("/entries/{entryId}/receipt")
op getEntryReceipt is Foundations.Operation<
EntryIdParameter,
KeepModel<EntryIdParameter>,
RawEntry,
ServiceTraits
>;
Expand All @@ -58,7 +60,7 @@ op getEntryReceipt is Foundations.Operation<
@doc("Historical query to get a list of entries of a given range")
@route("/entries/txIds")
op listEntryIds is Foundations.Operation<
TransactionsRange,
KeepModel<TransactionsRange>,
EntryIds,
ServiceTraits,
ServiceUnavailableError | Foundations.ErrorResponse
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,3 +269,7 @@ model CodeTransparencyConfigurationPolicy {
accepted_algorithms?: string[];
accepted_did_issuers?: string[];
}

model KeepModel<T> {
@bodyRoot body: T;
}
6 changes: 5 additions & 1 deletion specification/developersigning/DeveloperSigning/main.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ interface CertificateProfileOperations {
@pollingOperation(CertificateProfileOperations.getSigningStatus)
sign is StandardResourceOperations.LongRunningResourceAction<
CertificateProfileName,
SigningPayloadOptions,
KeepModel<SigningPayloadOptions>,
SignResult,
Foundations.ErrorResponse,
SigningRequestHeadersTraits
Expand Down Expand Up @@ -188,6 +188,10 @@ model BytesBody<ContentType> {
contentType: ContentType;
}

model KeepModel<T> {
@bodyRoot body: T;
}

alias SigningRequestHeadersTraits = Azure.Core.Traits.RequestHeadersTrait<{
@doc("An optional client version.")
@header
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,3 +104,7 @@ model Ipv6Address {
@doc("User equipment port.")
port: int32;
}

model KeepModel<T> {
@bodyRoot body: T;
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ interface DeviceLocation {
@doc("Verifies whether a device is within a specified location area, defined as an accuracy (radius) around a point, specified by longitude and latitude.")
verify is Operations.ResourceAction<
DeviceLocationEndpoint,
DeviceLocationVerificationContent,
KeepModel<DeviceLocationVerificationContent>,
DeviceLocationVerificationResult
>;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ interface DeviceNetwork {
@doc("Retrieves the network a given device is on. Returns network in a networkCode format that can be used for other APIs.")
retrieve is Operations.ResourceAction<
DeviceNetworkRetrievalEndpoint,
NetworkIdentifier,
KeepModel<NetworkIdentifier>,
NetworkRetrievalResult
>;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ interface NumberVerification {
@action("verify")
verifyWithoutCode is Operations.ResourceAction<
NumberVerificationEndpoint,
NumberVerificationWithoutCodeContent,
KeepModel<NumberVerificationWithoutCodeContent>,
TypeSpec.Http.Response<302> & {},
TraitOverride<ResponseHeadersTrait<{
@doc("The URI of the network's authorization endpoint, which should be followed by the front-end application.")
Expand All @@ -43,7 +43,7 @@ interface NumberVerification {
@action("verify")
verifyWithCode is Operations.ResourceAction<
NumberVerificationEndpoint,
NumberVerificationWithCodeContent,
KeepModel<NumberVerificationWithCodeContent>,
NumberVerificationResult
>;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ interface SimSwap {
@doc("Provides timestamp of latest SIM swap")
retrieve is Operations.ResourceAction<
SimSwapEndpoint,
SimSwapRetrievalContent,
KeepModel<SimSwapRetrievalContent>,
SimSwapRetrievalResult
>;

@doc("Verifies if a SIM swap has been performed during a past period (defined in the request with 'maxAgeHours' attribute). Returns 'True' if a SIM swap has occured.")
verify is Operations.ResourceAction<
SimSwapEndpoint,
SimSwapVerificationContent,
KeepModel<SimSwapVerificationContent>,
SimSwapVerificationResult
>;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1983,3 +1983,7 @@ model AtlasTypeDefHeader {
@doc("The name of the type definition.")
name?: string;
}

model KeepModel<T> {
@bodyRoot body: T;
}
Original file line number Diff line number Diff line change
Expand Up @@ -1623,7 +1623,7 @@ interface Discovery {
@route("/search/query")
@post
query is Azure.Core.Foundations.Operation<
QueryOptions,
KeepModel<QueryOptions>,
QueryResult,
{},
AtlasErrorResponse
Expand All @@ -1634,7 +1634,7 @@ interface Discovery {
@route("/search/suggest")
@post
suggest is Azure.Core.Foundations.Operation<
SuggestOptions,
KeepModel<SuggestOptions>,
SuggestResult,
{},
AtlasErrorResponse
Expand All @@ -1645,7 +1645,7 @@ interface Discovery {
@route("/search/autocomplete")
@post
autoComplete is Azure.Core.Foundations.Operation<
AutoCompleteOptions,
KeepModel<AutoCompleteOptions>,
AutoCompleteResult,
{},
AtlasErrorResponse
Expand Down
4 changes: 4 additions & 0 deletions specification/riskiq/Easm/models.tsp
Original file line number Diff line number Diff line change
Expand Up @@ -2155,3 +2155,7 @@ model DiscoGroupSummaryResult {
@doc("The name that can be used for display purposes.")
displayName: string;
}

model KeepModel<T> {
@bodyRoot body: T;
}
Loading
Loading