Git Product home page Git Product logo

Comments (5)

marcodpt avatar marcodpt commented on June 27, 2024 3

I work a lot writing servers using Rest API and servers for communicating with IOT devices.

I consider that .hurl files would be perfect for defining an API specification.

But without semantic validation the work becomes much more difficult, and the idea of ​​freezing a specification and building servers is a little weakened if I constantly have to change the .hurl files due to a change in order in the properties or if the files are unreadable by human beings.

from hurl.

fabricereix avatar fabricereix commented on June 27, 2024 1

This one is clearly not semantic

```
{ 
  "bar": true
}
```

but I'm not sure when the string type json is specified.

```json
{ 
  "bar": true
}
```

Setting such a request body adds automatically the `Content-Type: application/json' header.
So maybe this one should also be semantic.

from hurl.

marcodpt avatar marcodpt commented on June 27, 2024 1

I would like to thank you very much for your feedback.

I wasn't trying to argue about whether ```json should be semantic or not.

Actually, to be honest, I had forgotten that sending a direct json without a backtick works.

What I really miss is JSON semantic validation, which will allow me to migrate tests and documentation to the .hurl file.

I don't work much with XML in rust, but JSON seems like a not very difficult problem, but I don't really understand anything about the internal workings of hurl.

Semantic validation, for example, allows you to define the specification of an API in a .hurl file and at the same time serve as tests.

That in itself is beautiful, in the file format you define.

from hurl.

jcamiel avatar jcamiel commented on June 27, 2024

Hi @marcodpt

We're currently preparing the work for better error reporting and this work is the route to semantic difference.
A first batch of refacto is to be able to able to show better diff with multiline ```

The multiline check will not be semantic, whereas the JSON (and XML) body will be semantic. This way, user could choose to have semantic or "raw" diff.

To be clear (unless I'm mistaken of what we want @fabricereix )

Not semantic, raw diff, whitespaces sensitive:

GET https://foo.com/json
HTTP 200
```json
{ 
  "bar": true
}
```
GET https://foo.com/csv
HTTP 200
```
aaa,bbb,ccc
aaa,bbb,ccc
```

=> current work is to improve the error diag

Semantic, whitespaces unsensitive:

GET https://foo.com/json
HTTP 200
{ 
  "bar": true
}

from hurl.

jcamiel avatar jcamiel commented on June 27, 2024

Yes it makes sens

from hurl.

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.