Skip to content

Commit

Permalink
Documentation improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
YuriyDurov committed Sep 30, 2023
1 parent c3ae32f commit ae1da0d
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 3 deletions.
3 changes: 2 additions & 1 deletion docs/1.introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ Make sure to check out this [Sample application](/sample/OCPI.Net.Sample) for a
3. Enjoy the power of OCPI.Net!
You will find more info on how to use the package's functionality in the later sections of this documentation.
You will find more info on how to use the package's functionality in the later sections of this documentation. See [Implementation](3.implementation.md) for more information on how to implement OCPI modules using OCPI.Net.
---
Expand Down
22 changes: 20 additions & 2 deletions docs/7.versioning.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,24 @@ An [example](/sample/OCPI.Net.Sample/Controllers/OcpiVersionsController.cs) of h

In your Versions Module controller, inject the `IOcpiVersionsService` service and use it to retrieve the list of supported OCPI versions for each module:

```csharp
var versionService = serviceProvider.GetRequiredService<IOcpiVersionService>();
```

Use the `GetVersions` method to get a list of all supported OCPI versions:

```csharp
var versionInfo = versionService.GetVersions();
```

Use the `GetVersionDetails` method to get a list of all supported OCPI endpoints for a given version:

```csharp
var details = versionService.GetVersionDetails(request);
```

## Example Versions Module implementation

```csharp
[Route("versions")]
public class OcpiVersionsController : OcpiController
Expand Down Expand Up @@ -71,13 +89,13 @@ You can implement version-specific controllers for different versions of the sam
[Route("2.1.1/credentials")]
public class OcpiCredentialsV1Controller : OcpiController
{
// ...
// Code specific to OCPI 2.1.1
}

[OcpiEndpoint(OcpiModule.Credentials, "Receiver", "2.2.1")]
[Route("2.2.1/credentials")]
public class OcpiCredentialsV2Controller : OcpiController
{
// ...
// Code specific to OCPI 2.2.1
}
```
1 change: 1 addition & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,6 @@
- [Example implementation](6.pagination.md#example-implementation)
7. [Versioning](7.versioning.md)
- [How to implement OCPI Versions Module](7.versioning.md#how-to-implement-ocpi-versions-module)
- [Example Versions Module implementation](7.versioning.md#example-versions-module-implementation)
- [How to support multiple OCPI versions at the same time](7.versioning.md#how-to-support-multiple-ocpi-versions-at-the-same-time)
- [How to handle version-specific differences in OCPI modules](7.versioning.md#how-to-handle-version-specific-differences-in-ocpi-modules)

0 comments on commit ae1da0d

Please sign in to comment.