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

W, [2019-06-25T03:00:29.635993 #1] WARN -- : Unknown string format: guid #2

Closed
Tall-Paul opened this issue Jun 25, 2019 · 7 comments
Closed
Labels
enhancement New feature or request

Comments

@Tall-Paul
Copy link

Tall-Paul commented Jun 25, 2019

Hi,

When doing a 'get' request to fakeit running my spec file, the request never completes and the console shows this (continually):

W, [2019-06-25T03:00:29.635807 #1] WARN -- : Unknown string format: guid
W, [2019-06-25T03:00:29.635904 #1] WARN -- : Unknown string format: guid
W, [2019-06-25T03:00:29.635993 #1] WARN -- : Unknown string format: guid
W, [2019-06-25T03:00:29.636089 #1] WARN -- : Unknown string format: guid
W, [2019-06-25T03:00:29.636191 #1] WARN -- : Unknown string format: guid
W, [2019-06-25T03:00:29.636291 #1] WARN -- : Unknown string format: guid
W, [2019-06-25T03:00:29.636377 #1] WARN -- : Unknown string format: guid
W, [2019-06-25T03:00:29.636654 #1] WARN -- : Unknown string format: guid

My specification does have some fields with a format of 'guid', which isn't a standard format, but according to the documentation for the OpenApi specification it should be supported.

I'm not sure if this warning is related to the request not completing, but it seems a good bet.

This file works fine with 'prism' mock server by the way.

@JustinFeng
Copy link
Owner

JustinFeng commented Jun 25, 2019

Hey @Tall-Paul, you are right, guid format is not supported in current version, before it get supported, some work around on the current version could be:

  • use uuid instead, which is mentioned in https://swagger.io/docs/specification/data-models/data-types/, it will generate string with standard uuid format e.g. 0176c022-c974-449f-bf55-e4dea5074ecf
  • also you can always fallback to provide example for any unsupported format, and specify --use-example option

@JustinFeng JustinFeng added the enhancement New feature or request label Jun 25, 2019
@JustinFeng
Copy link
Owner

Also worth to mention, guid is not in the proposed additional format list OAI/OpenAPI-Specification#607, which makes me a bit hesitate to add guid to the supported format list.

It will be helpful for me to understand your use case, in terms of why guid is a better format choice than uuid

@Tall-Paul
Copy link
Author

hmm, no particular reason, we call them guids because we're a Microsoft house and... that's what they're always referred to.

I was under the impression though that the 'format' is open, and you can use anything you want in there rather than it being limited to certain types?

@JustinFeng
Copy link
Owner

Yep, that's totally right, OPENAPI has suggestion for unknown format here https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.0.md

Tools that do not recognize a specific format MAY default back to the type alone, as if the format is not specified.

So the WARNING message is just giving you feedback about fakeit doesn't know how to generate a random example for you. You should still get the response anyway.

Potentially it can be other reason If it fails to give you a success response.

@JustinFeng
Copy link
Owner

JustinFeng commented Jun 25, 2019

After look around the guid vs uuid discussion, I'm happy to add guid to the support list as it's a THING for anyone on the Microsoft tech stack.

Also please let me know whether do you just see the warning logs or the request actually fails in your case, cheers

@JustinFeng
Copy link
Owner

JustinFeng commented Jun 25, 2019

@Tall-Paul I added the support for guid format in the above commit.

Feel free to open a new issue if the request actually fails

@Tall-Paul
Copy link
Author

The request never completes, just spins while the console continuously repeats the warning.

I've attached the open api spec, nothing sensitive or secret in there.

openapi.zip

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