GithubHelp home page GithubHelp logo

Comments (19)

ralfhandl avatar ralfhandl commented on June 29, 2024

Both TripPinRESTierService and foo.xml work for me, using transform.cmd from a Windows command line, result is TripPinRestier.openapi3.zip

Which conversion tool did you use?

from odata-openapi.

devgoon avatar devgoon commented on June 29, 2024

from odata-openapi.

devgoon avatar devgoon commented on June 29, 2024

from odata-openapi.

ralfhandl avatar ralfhandl commented on June 29, 2024

Try ./transform while in folder tools to make sure you start the right command.

from odata-openapi.

devgoon avatar devgoon commented on June 29, 2024

Switch to Windows and I can't seem to generate pretty json on any of the examples. Here are my installation steps and the results of executing People.xml. I must be missing a step somewhere, perhaps you can spot it. Note: I did not install additional tools to run transform on Windows (yet) I wanted to just run Node and see what happens.

odata-openapi3 notes

  1. https://github.com/oasis-tcs/odata-openapi/blob/master/tools/README.md
  2. Install node-gyp
    a. Install tools per OS
  3. Install xslt4node via NPM
  4. Clone https://github.com/oasis-tcs/odata-openapi.git
  5. Install odata-openapi3 via NPM
  6. run odata-openapi3 -drp People.xml

Results:

C:\Users\vminnocci\Documents\code\odata-openapi\examples>odata2openapi` -drp People.xml
undefined:1
{"openapi":"3.0.0","info":{"title":"OData Service for namespace PeopleService","version":"","description":"This OData service is located at http://localhost/service-root/\n\n## Entity Data Model\nER Diagram\n\n## References\n- ProductService"},"servers":[{"url":"http://localhost/service-root"}],"tags":[{"name":"Suppliers"},{"name":"People"},{"name":"PersonDetails"}],"paths":{"/Suppliers":{"get":{"summary":"Get entities from Suppliers","tags":["Suppliers"],"parameters":[{"$ref":"#/components/parameters/top"},{"$ref":"#/components/parameters/skip"},{"$ref":"#/components/p

SyntaxError: Unexpected token : in JSON at position 13377
at JSON.parse ()
at xslt4node.transform (C:\Users\vminnocci\Documents\code\odata-openapi\tools\transform.js:142:66)

P.S. Not sure why it's rendering a diagram. I trying wrapping with "code", but no luck

from odata-openapi.

ralfhandl avatar ralfhandl commented on June 29, 2024

Should be fixed with 9b131d0, please check

from odata-openapi.

devgoon avatar devgoon commented on June 29, 2024

I'll give it a try. Thanks for you help

from odata-openapi.

devgoon avatar devgoon commented on June 29, 2024

from odata-openapi.

ralfhandl avatar ralfhandl commented on June 29, 2024

OData V4 is the preferred input format. In fact V2 and V3 require an additional transformation step to an intermediate V4 metadata file, which is done under the hood by the scripts.

from odata-openapi.

devgoon avatar devgoon commented on June 29, 2024

from odata-openapi.

ralfhandl avatar ralfhandl commented on June 29, 2024

Can you please send me the metadata file, I can't find an attachment.

from odata-openapi.

devgoon avatar devgoon commented on June 29, 2024

from odata-openapi.

ralfhandl avatar ralfhandl commented on June 29, 2024

Sorry, still no attachment. Can you upload it to this issue, similar to foo.zip on the initial post on this issue?
I'll look into it on Monday.

from odata-openapi.

devgoon avatar devgoon commented on June 29, 2024

from odata-openapi.

ralfhandl avatar ralfhandl commented on June 29, 2024

Hi Vico,

Cause of the error was an entity set with an entity type without a key definition: neither AL7_REPORT_FORMAT nor its abstract base type REPORT_FORMAT defines a key, and REPORT_FORMAT also doesn't have a base type. Without a key you can't have an entity set in OData.

The transformation now detects and logs this modeling error and produces well-formed JSON with ERROR: neither key nor base type strings as stand-in for the missing key.

The transformation now also deals more gracefully with invalid default values: 0, 1, no, No, and Yes aren't valid default values for Edm.Boolean, only true, false, and null are allowed. In general default values have to be type-compatible, so e.g. Now isn't valid for Edm.DateTimeOffset even if it doesn't lead to XML or JSON validation errors.

Please try out 16c8114.

Thanks!
Ralf

from odata-openapi.

devgoon avatar devgoon commented on June 29, 2024

from odata-openapi.

devgoon avatar devgoon commented on June 29, 2024

from odata-openapi.

ralfhandl avatar ralfhandl commented on June 29, 2024

Swagger UI 3.x, available at https://github.com/swagger-api/swagger-ui, already supports OpenAPI 3.0.1 out of the box.

from odata-openapi.

devgoon avatar devgoon commented on June 29, 2024

Resolved. Thanks Ralf.

from odata-openapi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.