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

Stronger Typing for send data? #64

Open
MaxClerkwell opened this issue Nov 7, 2023 · 1 comment
Open

Stronger Typing for send data? #64

MaxClerkwell opened this issue Nov 7, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@MaxClerkwell
Copy link
Contributor

pr #63 merged a function for sending data to a REST-API. I'd strongly encourage to upgrade to stronger typing, a URL might be a validated and constructed object from Skyr URL library, while the message should be validated json object from nlohmann/json.

Would love to get feedback on this.

@MaxClerkwell MaxClerkwell added the enhancement New feature or request label Nov 7, 2023
@R-Abbasi
Copy link
Collaborator

The Skyr ULR library looks like a parser to me, and perhaps there should already exist a url at hand for the project, for which the library can be used for parsing.

Creating a nlohmann::json object seems to be simple:

// Creating an object using initializer lists
nlohmann::json j = {
  {"ID", "xzy123"},
  {"VIN", "abcdef321"},
  {"milage", 456},
  {"Comment", "...."},
};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants