-
Notifications
You must be signed in to change notification settings - Fork 5
Add ListContexts endpoint to Server SDK #115
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
Conversation
Co-authored-by: kirre-bylund <4068377+kirre-bylund@users.noreply.github.com>
Co-authored-by: kirre-bylund <4068377+kirre-bylund@users.noreply.github.com>
kirre-bylund
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot I understand that you could not retrieve the API definition so it's ok. But this is all hallucination. Here's the spec:
openapi: 3.0.1
info:
title: ''
version: 1.0.0
paths:
/server/contexts/v1:
get:
summary: List Contexts
deprecated: false
description: ''
tags:
- Assets
parameters:
- name: page
in: query
description: ''
required: false
example: '1'
schema:
type: string
- name: per_page
in: query
description: ''
required: false
example: '5'
schema:
type: string
responses:
'200':
description: ''
content:
application/json:
schema:
type: object
properties:
contexts:
type: array
items:
type: object
properties:
id:
type: integer
description: Integer ID of the context
uuid:
type: string
description: Context UUID
name:
type: string
description: Context Name
required:
- id
- uuid
- name
x-apidog-orders:
- id
- uuid
- name
pagination:
$ref: '#/components/schemas/Offset%20Pagination'
required:
- contexts
- pagination
x-apidog-orders:
- contexts
- pagination
headers: {}
x-apidog-name: OK
security: []
x-apidog-folder: Assets
x-apidog-status: released
x-run-in-apidog: https://app.apidog.com/web/project/446498/apis/api-24155567-run
components:
schemas:
Offset Pagination:
type: object
properties:
errors:
type: array
items:
type: object
properties:
field:
type: string
description: 'Example: `page`, `per_page`'
message:
type: string
description: 'Example: "page must be a number greater than 0"'
x-apidog-orders:
- field
- message
required:
- field
- message
x-apidog-ignore-properties: []
description: >-
If the values provided don't allow for pagination to happen, errors
will be indicated within this array.
per_page:
type: integer
offset:
type: integer
description: How far you are within the total set of records.
total:
type: integer
description: How many items total were found.
last_page:
type: integer
current_page:
type: integer
next_page:
type: integer
nullable: true
prev_page:
type: integer
nullable: true
required:
- errors
- per_page
- offset
- total
- last_page
- current_page
- next_page
- prev_page
x-apidog-orders:
- errors
- per_page
- offset
- total
- last_page
- current_page
- next_page
- prev_page
x-apidog-ignore-properties: []
x-apidog-folder: ''Additionally, you have forgotten to expose the LootLockerServerAssetRequest.h method to the user through the public interface: LootLockerServerForCpp for the cpp interface and LootLockerServerForBlueprints for blueprint UFUNCTIONs.
| // Assets | ||
| FLootLockerServerEndPoint ULootLockerServerEndpoints::GetAssets = InitEndpoint("assets", ELootLockerServerHTTPMethod::GET); | ||
| FLootLockerServerEndPoint ULootLockerServerEndpoints::ListAssets = InitEndpoint("assets/artful-alpaca/v1", ELootLockerServerHTTPMethod::POST); | ||
| FLootLockerServerEndPoint ULootLockerServerEndpoints::ListContexts = InitEndpoint("contexts", ELootLockerServerHTTPMethod::GET); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| FLootLockerServerEndPoint ULootLockerServerEndpoints::ListContexts = InitEndpoint("contexts", ELootLockerServerHTTPMethod::GET); | |
| FLootLockerServerEndPoint ULootLockerServerEndpoints::ListContexts = InitEndpoint("contexts/v1", ELootLockerServerHTTPMethod::GET); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in commit 8eb9289. Updated endpoint to contexts/v1.
LootLockerServerSDK/Source/LootLockerServerSDK/Public/ServerAPI/LootLockerServerAssetRequest.h
Show resolved
Hide resolved
LootLockerServerSDK/Source/LootLockerServerSDK/Public/ServerAPI/LootLockerServerAssetRequest.h
Show resolved
Hide resolved
Co-authored-by: kirre-bylund <4068377+kirre-bylund@users.noreply.github.com>
Fixed in commit 8eb9289. Updated implementation based on the API spec:
|
LootLockerServerSDK/Source/LootLockerServerSDK/Public/LootLockerServerForBlueprints.h
Outdated
Show resolved
Hide resolved
LootLockerServerSDK/Source/LootLockerServerSDK/Public/LootLockerServerForCpp.h
Outdated
Show resolved
Hide resolved
|
@copilot last small changes now |
Co-authored-by: kirre-bylund <4068377+kirre-bylund@users.noreply.github.com>
Implementation Plan for List Contexts API ✅
Successfully added support for the List Contexts endpoint to the LootLocker Unreal Server SDK based on the actual API specification.
Checklist:
Implementation Summary:
Files Modified:
LootLockerServerAssetRequest.h- Fixed Context struct, added pagination to response, updated method signatureLootLockerServerAssetRequest.cpp- Added page/per_page query parametersLootLockerServerEndpoints.cpp- Fixed endpoint URL to contexts/v1LootLockerServerForCpp.h/cpp- Exposed method for C++ interfaceLootLockerServerForBlueprints.h/cpp- Exposed method for Blueprint interfaceAPI Details:
GET /server/contexts/v1ListContexts(int PerPage, int Page, ...)FLootLockerServerListContextsResponsewith contexts array and paginationContext Fields (per API spec):
Id(int) - Integer ID of the contextUuid(string) - Context UUIDName(string) - Context NamePagination:
FLootLockerServerExtendedIndexBasedPaginationto responsepageandper_pagequery parametersThe implementation now matches the actual API specification and is exposed through both C++ and Blueprint interfaces.
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.