Skip to content

Commit

Permalink
Merge pull request #9 from ejball/datetime
Browse files Browse the repository at this point in the history
  • Loading branch information
ejball authored Aug 11, 2023
2 parents a5eddf4 + 4a85919 commit 6fd26fb
Show file tree
Hide file tree
Showing 22 changed files with 49 additions and 12 deletions.
4 changes: 2 additions & 2 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project>

<PropertyGroup>
<VersionPrefix>2.7.0</VersionPrefix>
<VersionPrefix>2.8.0</VersionPrefix>
<LangVersion>11.0</LangVersion>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
Expand Down Expand Up @@ -33,7 +33,7 @@
</PropertyGroup>

<PropertyGroup>
<FacilityVersion>2.10.1</FacilityVersion>
<FacilityVersion>2.11.0</FacilityVersion>
</PropertyGroup>

<ItemGroup>
Expand Down
4 changes: 4 additions & 0 deletions ReleaseNotes.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Release Notes

## 2.8.0

* Support `datetime`.

## 2.7.0

* Support `extern` data and enum types.
Expand Down
19 changes: 12 additions & 7 deletions conformance/ConformanceApi.fsd
Original file line number Diff line number Diff line change
Expand Up @@ -149,14 +149,13 @@ service ConformanceApi
int32: int32;
int64: int64;
decimal: decimal;

[validate]
enum: Answer;
[validate] enum: Answer;
datetime: datetime;
}:
{
}

[http(method: GET, path: "/checkPath/{string}/{boolean}/{double}/{int32}/{int64}/{decimal}/{enum}")]
[http(method: GET, path: "/checkPath/{string}/{boolean}/{double}/{int32}/{int64}/{decimal}/{enum}/{datetime}")]
method checkPath
{
string: string;
Expand All @@ -165,9 +164,8 @@ service ConformanceApi
int32: int32;
int64: int64;
decimal: decimal;

[validate]
enum: Answer;
[validate] enum: Answer;
datetime: datetime;
}:
{
}
Expand All @@ -182,6 +180,7 @@ service ConformanceApi
[http(from: header)] int64: int64;
[http(from: header)] decimal: decimal;
[http(from: header)] enum: Answer;
[http(from: header)] datetime: datetime;
}:
{
[http(from: header)] string: string;
Expand All @@ -191,6 +190,7 @@ service ConformanceApi
[http(from: header)] int64: int64;
[http(from: header)] decimal: decimal;
[http(from: header)] enum: Answer;
[http(from: header)] datetime: datetime;
}

[http(path: "/mixed/{path}")]
Expand Down Expand Up @@ -261,6 +261,7 @@ service ConformanceApi
int32: int32;
int64: int64;
decimal: decimal;
datetime: datetime;
bytes: bytes;
object: object;
error: error;
Expand All @@ -280,6 +281,7 @@ service ConformanceApi
int32: int32[];
int64: int64[];
decimal: decimal[];
datetime: datetime[];
bytes: bytes[];
object: object[];
error: error[];
Expand All @@ -299,6 +301,7 @@ service ConformanceApi
int32: map<int32>;
int64: map<int64>;
decimal: map<decimal>;
datetime: map<datetime>;
bytes: map<bytes>;
object: map<object>;
error: map<error>;
Expand All @@ -318,6 +321,7 @@ service ConformanceApi
int32: result<int32>;
int64: result<int64>;
decimal: result<decimal>;
datetime: result<datetime>;
bytes: result<bytes>;
object: result<object>;
error: result<error>;
Expand All @@ -337,6 +341,7 @@ service ConformanceApi
int32: nullable<int32>;
int64: nullable<int64>;
decimal: nullable<decimal>;
datetime: nullable<datetime>;
bytes: nullable<bytes>;
object: nullable<object>;
error: nullable<error>;
Expand Down
2 changes: 1 addition & 1 deletion conformance/http/ConformanceApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ API for a Facility test server.
| [getWidgetBatch](ConformanceApi/getWidgetBatch.md) | `POST /widgets/get` | Gets the specified widgets. |
| [mirrorFields](ConformanceApi/mirrorFields.md) | `POST /mirrorFields` | |
| [checkQuery](ConformanceApi/checkQuery.md) | `GET /checkQuery` | |
| [checkPath](ConformanceApi/checkPath.md) | `GET /checkPath/{string}/{boolean}/{double}/{int32}/{int64}/{decimal}/{enum}` | |
| [checkPath](ConformanceApi/checkPath.md) | `GET /checkPath/{string}/{boolean}/{double}/{int32}/{int64}/{decimal}/{enum}/{datetime}` | |
| [mirrorHeaders](ConformanceApi/mirrorHeaders.md) | `GET /mirrorHeaders` | |
| [mixed](ConformanceApi/mixed.md) | `POST /mixed/{path}` | |
| [required](ConformanceApi/required.md) | `POST /required` | |
Expand Down
2 changes: 2 additions & 0 deletions conformance/http/ConformanceApi/Any.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"int32": (integer),
"int64": (integer),
"decimal": (number),
"datetime": "(date/time)",
"bytes": "(base64)",
"object": { ... },
"error": { "code": ... },
Expand All @@ -28,6 +29,7 @@
| int32 | int32 | |
| int64 | int64 | |
| decimal | decimal | |
| datetime | datetime | |
| bytes | bytes | |
| object | object | |
| error | error | |
Expand Down
2 changes: 2 additions & 0 deletions conformance/http/ConformanceApi/AnyArray.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"int32": [ (integer), ... ],
"int64": [ (integer), ... ],
"decimal": [ (number), ... ],
"datetime": [ "(date/time)", ... ],
"bytes": [ "(base64)", ... ],
"object": [ { ... }, ... ],
"error": [ { "code": ... }, ... ],
Expand All @@ -28,6 +29,7 @@
| int32 | int32[] | |
| int64 | int64[] | |
| decimal | decimal[] | |
| datetime | datetime[] | |
| bytes | bytes[] | |
| object | object[] | |
| error | error[] | |
Expand Down
2 changes: 2 additions & 0 deletions conformance/http/ConformanceApi/AnyMap.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"int32": { "...": (integer), ... },
"int64": { "...": (integer), ... },
"decimal": { "...": (number), ... },
"datetime": { "...": "(date/time)", ... },
"bytes": { "...": "(base64)", ... },
"object": { "...": { ... }, ... },
"error": { "...": { "code": ... }, ... },
Expand All @@ -28,6 +29,7 @@
| int32 | map<int32> | |
| int64 | map<int64> | |
| decimal | map<decimal> | |
| datetime | map<datetime> | |
| bytes | map<bytes> | |
| object | map<object> | |
| error | map<error> | |
Expand Down
2 changes: 2 additions & 0 deletions conformance/http/ConformanceApi/AnyNullable.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"int32": (integer) | null,
"int64": (integer) | null,
"decimal": (number) | null,
"datetime": "(date/time)" | null,
"bytes": "(base64)" | null,
"object": { ... } | null,
"error": { "code": ... } | null,
Expand All @@ -27,6 +28,7 @@
| int32 | nullable<int32> | |
| int64 | nullable<int64> | |
| decimal | nullable<decimal> | |
| datetime | nullable<datetime> | |
| bytes | nullable<bytes> | |
| object | nullable<object> | |
| error | nullable<error> | |
Expand Down
2 changes: 2 additions & 0 deletions conformance/http/ConformanceApi/AnyResult.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"int32": { "value": (integer) | "error": { "code": ... } },
"int64": { "value": (integer) | "error": { "code": ... } },
"decimal": { "value": (number) | "error": { "code": ... } },
"datetime": { "value": "(date/time)" | "error": { "code": ... } },
"bytes": { "value": "(base64)" | "error": { "code": ... } },
"object": { "value": { ... } | "error": { "code": ... } },
"error": { "value": { "code": ... } | "error": { "code": ... } },
Expand All @@ -28,6 +29,7 @@
| int32 | result<int32> | |
| int64 | result<int64> | |
| decimal | result<decimal> | |
| datetime | result<datetime> | |
| bytes | result<bytes> | |
| object | result<object> | |
| error | result<error> | |
Expand Down
3 changes: 2 additions & 1 deletion conformance/http/ConformanceApi/checkPath.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# checkPath

```
GET /checkPath/{string}/{boolean}/{double}/{int32}/{int64}/{decimal}/{enum}
GET /checkPath/{string}/{boolean}/{double}/{int32}/{int64}/{decimal}/{enum}/{datetime}
--- 200 OK
```

Expand All @@ -14,5 +14,6 @@ GET /checkPath/{string}/{boolean}/{double}/{int32}/{int64}/{decimal}/{enum}
| int64 | int64 | |
| decimal | decimal | |
| enum | [Answer](Answer.md) | |
| datetime | datetime | |

<!-- DO NOT EDIT: generated by fsdgenmd -->
2 changes: 2 additions & 0 deletions conformance/http/ConformanceApi/checkQuery.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ GET /checkQuery
&int64={int64}
&decimal={decimal}
&enum={enum}
&datetime={datetime}
--- 200 OK
```

Expand All @@ -21,5 +22,6 @@ GET /checkQuery
| int64 | int64 | |
| decimal | decimal | |
| enum | [Answer](Answer.md) | |
| datetime | datetime | |

<!-- DO NOT EDIT: generated by fsdgenmd -->
4 changes: 4 additions & 0 deletions conformance/http/ConformanceApi/mirrorHeaders.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ int32: (int32)
int64: (int64)
decimal: (decimal)
enum: (enum)
datetime: (datetime)
--- response
string: (string)
boolean: (boolean)
Expand All @@ -17,6 +18,7 @@ int32: (int32)
int64: (int64)
decimal: (decimal)
enum: (enum)
datetime: (datetime)
--- 200 OK
```

Expand All @@ -29,6 +31,7 @@ enum: (enum)
| int64 | int64 | |
| decimal | decimal | |
| enum | [Answer](Answer.md) | |
| datetime | datetime | |

| response | type | description |
| --- | --- | --- |
Expand All @@ -39,5 +42,6 @@ enum: (enum)
| int64 | int64 | |
| decimal | decimal | |
| enum | [Answer](Answer.md) | |
| datetime | datetime | |

<!-- DO NOT EDIT: generated by fsdgenmd -->
1 change: 1 addition & 0 deletions conformance/no-http/ConformanceApi/Any.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
| int32 | int32 | |
| int64 | int64 | |
| decimal | decimal | |
| datetime | datetime | |
| bytes | bytes | |
| object | object | |
| error | error | |
Expand Down
1 change: 1 addition & 0 deletions conformance/no-http/ConformanceApi/AnyArray.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
| int32 | int32[] | |
| int64 | int64[] | |
| decimal | decimal[] | |
| datetime | datetime[] | |
| bytes | bytes[] | |
| object | object[] | |
| error | error[] | |
Expand Down
1 change: 1 addition & 0 deletions conformance/no-http/ConformanceApi/AnyMap.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
| int32 | map<int32> | |
| int64 | map<int64> | |
| decimal | map<decimal> | |
| datetime | map<datetime> | |
| bytes | map<bytes> | |
| object | map<object> | |
| error | map<error> | |
Expand Down
1 change: 1 addition & 0 deletions conformance/no-http/ConformanceApi/AnyNullable.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
| int32 | nullable<int32> | |
| int64 | nullable<int64> | |
| decimal | nullable<decimal> | |
| datetime | nullable<datetime> | |
| bytes | nullable<bytes> | |
| object | nullable<object> | |
| error | nullable<error> | |
Expand Down
1 change: 1 addition & 0 deletions conformance/no-http/ConformanceApi/AnyResult.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
| int32 | result<int32> | |
| int64 | result<int64> | |
| decimal | result<decimal> | |
| datetime | result<datetime> | |
| bytes | result<bytes> | |
| object | result<object> | |
| error | result<error> | |
Expand Down
1 change: 1 addition & 0 deletions conformance/no-http/ConformanceApi/checkPath.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@
| int64 | int64 | |
| decimal | decimal | |
| enum | [Answer](Answer.md) | |
| datetime | datetime | |

<!-- DO NOT EDIT: generated by fsdgenmd -->
1 change: 1 addition & 0 deletions conformance/no-http/ConformanceApi/checkQuery.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@
| int64 | int64 | |
| decimal | decimal | |
| enum | [Answer](Answer.md) | |
| datetime | datetime | |

<!-- DO NOT EDIT: generated by fsdgenmd -->
2 changes: 2 additions & 0 deletions conformance/no-http/ConformanceApi/mirrorHeaders.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
| int64 | int64 | |
| decimal | decimal | |
| enum | [Answer](Answer.md) | |
| datetime | datetime | |

| response | type | description |
| --- | --- | --- |
Expand All @@ -19,5 +20,6 @@
| int64 | int64 | |
| decimal | decimal | |
| enum | [Answer](Answer.md) | |
| datetime | datetime | |

<!-- DO NOT EDIT: generated by fsdgenmd -->
2 changes: 1 addition & 1 deletion dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"isRoot": true,
"tools": {
"facilityconformance": {
"version": "2.19.0",
"version": "2.21.0",
"commands": [
"FacilityConformance"
]
Expand Down
2 changes: 2 additions & 0 deletions src/Facility.CodeGen.Markdown/MarkdownGeneratorGlobals.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public static string RenderFieldType(ServiceTypeInfo typeInfo) =>
ServiceTypeKind.Int64 => "int64",
ServiceTypeKind.Decimal => "decimal",
ServiceTypeKind.Bytes => "bytes",
ServiceTypeKind.DateTime => "datetime",
ServiceTypeKind.Object => "object",
ServiceTypeKind.Error => "error",
ServiceTypeKind.Dto => $"[{typeInfo.Dto!.Name}]({typeInfo.Dto.Name}.md)",
Expand All @@ -59,6 +60,7 @@ public static string RenderFieldTypeAsJsonValue(ServiceTypeInfo typeInfo) =>
ServiceTypeKind.Int32 => "(integer)",
ServiceTypeKind.Int64 => "(integer)",
ServiceTypeKind.Bytes => "\"(base64)\"",
ServiceTypeKind.DateTime => "\"(date/time)\"",
ServiceTypeKind.Object => "{ ... }",
ServiceTypeKind.Error => "{ \"code\": ... }",
ServiceTypeKind.Dto => RenderDtoAsJsonValue(typeInfo.Dto!),
Expand Down

0 comments on commit 6fd26fb

Please sign in to comment.