PostgREST / postgrest-openapi

OpenAPI output generated in SQL for a PostgREST instance
MIT License
17 stars 4 forks source link

Feature/servers #22

Closed wayland closed 10 months ago

wayland commented 10 months ago
wayland commented 10 months ago

Hi all! Here's my PR for the servers/x-software stuff. I'm expecting to be told I've done a number of things wrong. I probably won't have a chance to look at the corrections for another week.

Thanks!

wayland commented 10 months ago

Interesting! The tests are failing. They worked on my local (I'm testing with a pretty recent Postgres, though). I note the following error which wasn't present on my local.

The postmaster has commanded this server process to roll back the current transaction and exit, because another server process exited abnormally and possibly corrupted shared memory.

I'm not familiar enough with nix to figure out what's going on.

Question: is anyone else able to replicate the test failures on their local?

steve-chavez commented 10 months ago

@wayland Yes, I'm able to replicate the errors locally. (I do realize the CI is not being informative, will fix)

The error happens on pg 14 and 13, the output varies there:

diff -U3 /home/stevechavez/Projects/postgrest-openapi/test/expected/servers.out /home/stevechavez/Projects/postgrest-openapi/output/results/servers.out
--- /home/stevechavez/Projects/postgrest-openapi/test/expected/servers.out  2023-11-04 18:19:12.619939571 -0500
+++ /home/stevechavez/Projects/postgrest-openapi/output/results/servers.out 2023-11-04 18:21:30.704413555 -0500
@@ -53,16 +53,16 @@
 -----------------------------------------------------------------------------
  [                                                                          +
      {                                                                      +
-         "url": "https://www.example.com/api/",                             +
-         "description": "Overriding URL"                                    +
-     },                                                                     +
-     {                                                                      +
          "url": "https://www.example.com/otherapi/?s={s}&browser={browser}",+
          "variables": {                                                     +
              "s": "worms",                                                  +
              "browser": "none"                                              +
          },                                                                 +
          "description": "Additional URL"                                    +
+     },                                                                     +
+     {                                                                      +
+         "url": "https://www.example.com/api/",                             +
+         "description": "Overriding URL"                                    +
      }                                                                      +
  ]
 (1 row)
steve-chavez commented 10 months ago

@wayland Just merged https://github.com/PostgREST/postgrest-openapi/pull/23. Once you rebase you should be able to see the diff with the failures.

wayland commented 10 months ago

Thanks! I've added the ORDER BY, so it should work now. Looks like the tests pass now.

HTH,

wayland commented 10 months ago

Thanks for your feedback. I've done some edits in line with what you've suggested. Let me know if there are further issues.