All Verbs | /protoc/{Lang} |
---|
Imports System
Imports System.Collections
Imports System.Collections.Generic
Imports System.Runtime.Serialization
Imports ServiceStack
Imports ServiceStack.DataAnnotations
Imports ProtocApi.ServiceModel
Namespace Global
Namespace ProtocApi.ServiceModel
Public Partial Class Protoc
Public Sub New()
Files = New Dictionary(Of String, String)
End Sub
Public Overridable Property Lang As ProtocLang
Public Overridable Property Files As Dictionary(Of String, String)
Public Overridable Property ProtoUrl As String
End Class
<DataContract>
Public Enum ProtocLang
<EnumMember(Value:="cpp")>
Cpp
<EnumMember(Value:="csharp")>
CSharp
<EnumMember(Value:="dart")>
Dart
<EnumMember(Value:="java")>
Java
<EnumMember(Value:="java-lite")>
JavaLite
<EnumMember(Value:="objc")>
ObjectiveC
<EnumMember(Value:="php")>
Php
<EnumMember(Value:="python")>
Python
<EnumMember(Value:="ruby")>
Ruby
<EnumMember(Value:="go")>
Go
<EnumMember(Value:="js-closure")>
JavaScriptClosure
<EnumMember(Value:="js-commonjs")>
JavaScriptCommonJs
<EnumMember(Value:="js-node")>
JavaScriptNodeJs
<EnumMember(Value:="swift")>
Swift
<EnumMember(Value:="ts")>
TypeScript
<EnumMember(Value:="ts-binary")>
TypeScriptBinary
End Enum
Public Partial Class ProtocResponse
Public Sub New()
GeneratedFiles = New Dictionary(Of String, String)
End Sub
Public Overridable Property Lang As ProtocLang
Public Overridable Property GeneratedFiles As Dictionary(Of String, String)
Public Overridable Property ArchiveUrl As String
Public Overridable Property ResponseStatus As ResponseStatus
End Class
End Namespace
End Namespace
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /protoc/{Lang} HTTP/1.1
Host: grpc.servicestack.net
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
lang: cpp,
files:
{
String: String
},
protoUrl: String
}
HTTP/1.1 200 OK Content-Type: text/jsv Content-Length: length { lang: cpp, generatedFiles: { String: String }, archiveUrl: String, responseStatus: { errorCode: String, message: String, stackTrace: String, errors: [ { errorCode: String, fieldName: String, message: String, meta: { String: String } } ], meta: { String: String } } }